Skip to content

Commit 31b1b68

Browse files
authored
Merge pull request #62 from reactome/adding-tests RISKY!!
2 parents 3c5d811 + 6dec8eb commit 31b1b68

45 files changed

Lines changed: 1717 additions & 1616 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,8 @@ package-lock.json
6868
# Ignore Yarn lock file
6969
yarn.lock
7070
/src/assets/reacfoam/@carrotsearch/
71+
72+
# Playwright
73+
/test-results/
74+
/playwright-report/
75+
/playwright/.cache/

angular.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,7 @@
205205
"builder": "@angular-devkit/build-angular:extract-i18n"
206206
},
207207
"test": {
208-
"builder": "@angular-devkit/build-angular:karma",
209-
"options": {
210-
"polyfills": ["zone.js", "zone.js/testing"],
211-
"tsConfig": "tsconfig.spec.json",
212-
"inlineStyleLanguage": "scss",
213-
"assets": [
214-
{
215-
"glob": "**/*",
216-
"input": "projects/website-angular/public"
217-
}
218-
],
219-
"styles": ["projects/website-angular/src/styles.scss"],
220-
"scripts": []
221-
}
208+
"builder": "@analogjs/vitest-angular:test"
222209
}
223210
}
224211
},

e2e/search.spec.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test.describe('Search flow', () => {
4+
test('search TP53, click first result, verify detail page', async ({ page }) => {
5+
await page.goto('/content/query?q=TP53');
6+
await expect(page.locator('.result-count')).toBeVisible({ timeout: 15000 });
7+
await expect(page.locator('.result-count')).toContainText('results found');
8+
9+
const firstResult = page.locator('.entry-name').first();
10+
await expect(firstResult).toBeVisible();
11+
await firstResult.click();
12+
13+
await expect(page).toHaveURL(/\/content\/detail\//);
14+
});
15+
16+
test('search nonexistent term, verify no-results section', async ({ page }) => {
17+
await page.goto('/content/query?q=xyzzy_no_match_99999');
18+
await expect(page.locator('.no-results')).toBeVisible({ timeout: 15000 });
19+
await expect(page.locator('.no-results h2')).toContainText('No results found');
20+
});
21+
22+
test('search apoptosis, click a facet, verify filter chip appears', async ({ page }) => {
23+
await page.goto('/content/query?q=apoptosis');
24+
await expect(page.locator('.result-count')).toBeVisible({ timeout: 15000 });
25+
26+
const firstFacet = page.locator('.facet-option').first();
27+
await expect(firstFacet).toBeVisible();
28+
await firstFacet.click();
29+
30+
await expect(page.locator('.filter-chip')).toBeVisible({ timeout: 10000 });
31+
});
32+
});

0 commit comments

Comments
 (0)