-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from SolidLabResearch/fix/sources-from-indexF…
…ile-problem Fix/sources from index file problem
- Loading branch information
Showing
8 changed files
with
90 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ describe("Sources from index file", () => { | |
|
||
// Check that it indeed had 3 sources | ||
cy.get('.information-box').contains('Sources: 3'); | ||
|
||
// Check if correct data is displayed | ||
cy.contains("http://www/example.com/data/component-c01"); | ||
cy.contains("Component 1"); | ||
|
@@ -31,7 +31,7 @@ describe("Sources from index file", () => { | |
|
||
// Check that all 4 sources were used | ||
cy.get('.information-box').contains('Sources: 4'); | ||
|
||
// Check if correct data is still displayed even if one source was unauthorized | ||
cy.contains("http://www/example.com/data/component-c01"); | ||
cy.contains("Component 1"); | ||
|
@@ -50,11 +50,58 @@ describe("Sources from index file", () => { | |
|
||
// Check that the 4 sources were successfully merged | ||
cy.get('.information-box').contains('Sources: 4'); | ||
|
||
// Check if correct data is still displayed even if one source was unauthorized and different sources were merged | ||
cy.contains("http://www/example.com/data/component-c01"); | ||
cy.contains("Component 1"); | ||
cy.contains("Material 1"); | ||
}); | ||
|
||
it("Sources from an unauthorized source. Before and after log in.", () => { | ||
cy.visit("/"); | ||
|
||
cy.intercept('GET', 'http://localhost:8080/example/index-example-texon-only-AUTH').as('getRequest'); | ||
|
||
// Navigate to correct query | ||
cy.contains("For testing only").click(); | ||
cy.contains("Sources from an index file (requiring authentication)").click(); | ||
|
||
// Wait for the request and assert the response | ||
cy.wait('@getRequest').then((interception) => { | ||
expect(interception.response.statusCode).to.equal(401); | ||
}); | ||
|
||
|
||
cy.contains("http://www/example.com/data/component-c01").should("not.exist"); | ||
cy.contains("Component 1").should("not.exist"); | ||
cy.contains("Material 1").should("not.exist"); | ||
|
||
//log in | ||
cy.get('[aria-label="Profile"]').click(); | ||
cy.contains('[role="menuitem"]', "Login").click(); | ||
|
||
cy.get('input[name="idp"]') | ||
.clear(); | ||
cy.get('input[name="idp"]') | ||
.type("http://localhost:8080/example/profile/card#me"); | ||
cy.contains("Login").click(); | ||
|
||
cy.get("input#email").type("[email protected]"); | ||
cy.get("input#password").type("abc123"); | ||
cy.contains("button", "Log in").click(); | ||
cy.contains("button", "Authorize").click(); | ||
|
||
cy.url().should("eq", "http://localhost:5173/"); | ||
|
||
//now try again | ||
cy.contains("For testing only").click(); | ||
cy.contains("Sources from an index file (requiring authentication)").click(); | ||
|
||
cy.contains("http://www/example.com/data/component-c01").should("not.exist"); | ||
cy.contains("Component 1").should("exist"); | ||
cy.contains("Material 1").should("exist"); | ||
}) | ||
|
||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
|
||
<#index-example> rdfs:seeAlso | ||
<http://localhost:8080/example/boms>, | ||
<http://localhost:8080/example/components>, | ||
<http://localhost:8080/example/materials> | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@prefix acl: <http://www.w3.org/ns/auth/acl#>. | ||
@prefix foaf: <http://xmlns.com/foaf/0.1/>. | ||
|
||
<#owner> | ||
a acl:Authorization; | ||
acl:accessTo <./index-example-texon-only-AUTH>; | ||
acl:agent <http://localhost:8080/example/profile/card#me>; | ||
acl:mode acl:Read, acl:Write, acl:Control. | ||
|
8 changes: 8 additions & 0 deletions
8
public/queries/sourceQueries/index_example_texon_only_source_AUTH.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX example: <http://localhost:8080/example/index-example-texon-only-AUTH#> | ||
|
||
SELECT ?object | ||
WHERE { | ||
example:index-example rdfs:seeAlso ?object . | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters