Skip to content

Commit 2709224

Browse files
committed
applied changes request
1 parent e8d6a91 commit 2709224

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

cypress/e2e/fetch-status.cy.js

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,21 @@ describe("Fetch Status", () => {
55
cy.visit("/");
66

77
// Go immediately to query
8-
cy.contains("Mixed book query").click();
9-
10-
// Open the sources and verify
11-
cy.get('[aria-label="Sources info"]').click();
12-
cy.get('[aria-label="Verify source"]').each(($button) => {
13-
cy.wrap($button).click();
14-
});
8+
cy.contains("A book query testing sources with and without authentication required").click();
159

1610
// Check if the public and restricted sources appear
11+
cy.get('[aria-label="Sources info"]').click();
12+
1713
cy.contains("http://localhost:8080/example/favourite-books");
1814
cy.contains("http://localhost:8080/example/wish-list");
1915

2016
// Check if the correct icons appear
2117
cy.get('[aria-label="Authentication required"]').should("exist");
2218
cy.get('[aria-label="Fetch failed"]').should("exist");
23-
cy.get('[aria-label="Verification failed"]').should("exist")
2419

2520
cy.get('[aria-label="No authentication required"]').should("exist");
2621
cy.get('[aria-label="Fetch was succesful"]').should("exist");
27-
cy.get('[aria-label="Verification succeeded"]').should("exist");
22+
2823

2924
// Checking that a non-authorized book is not appearing
3025
cy.contains("It Ends With Us").should("not.exist");
@@ -54,26 +49,20 @@ describe("Fetch Status", () => {
5449
cy.url().should("eq", "http://localhost:5173/");
5550

5651
// Go to the mixed book query
57-
cy.contains("Mixed book query").click();
52+
cy.contains("A book query testing sources with and without authentication required").click();
5853

59-
// Open the sources and verify
54+
// Check if the public and restricted sources appear
6055
cy.get('[aria-label="Sources info"]').click();
61-
cy.get('[aria-label="Verify source"]').each(($button) => {
62-
cy.wrap($button).click();
63-
});
6456

65-
// Check if the public and restricted sources appear
6657
cy.contains("http://localhost:8080/example/favourite-books");
6758
cy.contains("http://localhost:8080/example/wish-list");
6859

6960
// Check if the correct icons appear
7061
cy.get('[aria-label="Authentication required"]').should("exist");
7162
cy.get('[aria-label="Fetch Failed"]').should("not.exist");
72-
cy.get('[aria-label="Verification failed"]').should("not.exist");
7363

7464
cy.get('[aria-label="No authentication required"]').should("exist");
7565
cy.get('[aria-label="Fetch was succesful"]').should("exist");
76-
cy.get('[aria-label="Verification succeeded"]').should("exist");
7766

7867
// Checking that you see authorized books
7968
cy.contains("It Ends With Us");

src/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
},
8282
{
8383
"queryLocation": "books.rq",
84-
"name": "Mixed book query",
85-
"description": "A list of books I'd love to own",
84+
"name": "A book query testing sources with and without authentication required",
85+
"description": "A short list of some of my favorite books and books I'd love to own",
8686
"icon": "MenuBookIcon",
8787
"id": "4200",
8888
"comunicaContext": {

src/dataProvider/SparqlDataProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function statusFetch(customFetch, context) {
238238
const wrappedFetchFunction = async (arg) => {
239239
try{
240240
const response = await customFetch(arg);
241-
context.fetchSuccess[arg] = response.ok; // <--- oplossing issue probleem hier, response is een object en heeft de prop "ok" die een bool is.
241+
context.fetchSuccess[arg] = response.ok;
242242
return response;
243243
}
244244
catch(error){

0 commit comments

Comments
 (0)