-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an integration test, which accesses the KG rather than using mock…
… data.
- Loading branch information
Showing
7 changed files
with
55 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const authToken = null; // for local testing, provide an EBRAINS IAM token | ||
|
||
export { authToken }; |
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,27 @@ | ||
import { describe, test, expect } from "vitest"; | ||
import { render, screen } from "@testing-library/react"; | ||
import App from "../../src/main"; | ||
import { authToken } from "../globals"; | ||
|
||
describe("test with real KG queries", () => { | ||
// this test requires a valid auth token to have been set in globals.js, | ||
// since it actually makes KG queries | ||
test("check home route with KG", { timeout: 10000 }, async () => { | ||
const auth = { | ||
token: authToken, | ||
}; | ||
render(<App auth={auth} />); | ||
|
||
expect(screen.getByText("EBRAINS: Neural Activity Resource (alpha)")).toBeDefined(); | ||
|
||
const label = await screen.findByText("Patch clamp recording", {}, { timeout: 10000 }); | ||
expect(label).toBeDefined(); | ||
|
||
const datasetCountChip = await screen.findByTitle( | ||
"All neural activity datasets count", | ||
{}, | ||
{ timeout: 10000 } | ||
); | ||
expect(parseInt(datasetCountChip.textContent)).toBeGreaterThan(0); | ||
}); | ||
}); |
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
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