Skip to content

Commit

Permalink
fix tests, remove obsolete test, add npm test to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Terézia Slanináková committed Sep 30, 2024
1 parent f061c9b commit 4c0f312
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
# Push events on main and dev branch
- main
- fair-impact-hw1
- ui-tests
# Sequence of patterns matched against refs/tags
tags: '*'

Expand All @@ -18,6 +18,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '21.6.0' # Match the version in your Dockerfile

- name: Install UI dependencies
working-directory: ./ui
run: npm ci

- name: Run UI tests
working-directory: ./ui
run: npm test

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
5 changes: 2 additions & 3 deletions ui/tests/load-info-box.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('LoadInfoBox', () => {
expect(el?.querySelectorAll("li")[0].textContent).contain("Query");
expect(el?.querySelectorAll("li")[1].textContent).contain("Name: BBB");
expect(el?.querySelectorAll("li")[2].textContent).contain("Organism: CCC");
expect(el?.querySelectorAll("li")[3].textContent).contain("AAA in AlphaFold");
expect(el?.querySelectorAll("li")[3].textContent).contain("AAA in UniProt");
expect(el?.querySelectorAll("li")[4].textContent).contain("Search Time");
});

Expand All @@ -68,11 +68,10 @@ describe('LoadInfoBox', () => {
expect(el?.querySelectorAll("li")[0].textContent).contain("Query");
expect(el?.querySelectorAll("li")[1].textContent).contain("Name: BBB");
expect(el?.querySelectorAll("li")[2].textContent).contain("Organism: CCC");
expect(el?.querySelectorAll("li")[3].textContent).contain("AAA in AlphaFold");
expect(el?.querySelectorAll("li")[3].textContent).contain("AAA in UniProt");
expect(el?.querySelectorAll("li")[4].textContent).contain("Search Time");

const spinner = container.querySelector('.spinner-border');
expect(spinner).exist;
expect(spinner?.textContent).contain("Loading...");
});
});

0 comments on commit 4c0f312

Please sign in to comment.