Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparkier committed Dec 12, 2023
1 parent e56fb9e commit d544242
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
1 change: 1 addition & 0 deletions frontend/src/lib/components/general/HeaderIcon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class="m-auto flex cursor-pointer items-center p-3 hover:bg-black-transparent"
on:click
use:tooltip={{ text: tooltipContent }}
aria-label={pageName}
>
<div class="h-6 w-6 fill-grey">
<Icon style="outline:none" tag="svg" viewBox="0 0 24 24">
Expand Down
44 changes: 27 additions & 17 deletions frontend/tests/project.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,34 @@ test('can see project header', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'GPT MT Benchmarks' })).toBeVisible();
});

test('slice and tags are present', async ({ page }) => {
await expect(page.getByRole('button', { name: 'All instances' })).toBeVisible();
await expect(page.getByRole('button', { name: 'short latin' })).toBeVisible();
await expect(page.getByRole('button', { name: 'random tag' })).toBeVisible();
test('can see overview table', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Overview Table' })).toBeVisible();
});

test('can filter by slice', async ({ page }) => {
await page.getByText('short latin').click();
const grid = await page.locator('.grid').first();
await expect(grid.getByRole('button').first()).toContainText(
"That didn't seem to make sense to me; it certainly wasn't fair."
);
});
test.describe('explore', () => {
test.beforeEach(async ({ page }) => {
await page.locator("button[aria-label='explore']").click();
});

test('slice and tags are present', async ({ page }) => {
await expect(page.getByRole('button', { name: 'All instances' })).toBeVisible();
await expect(page.getByRole('button', { name: 'short latin' })).toBeVisible();
await expect(page.getByRole('button', { name: 'random tag' })).toBeVisible();
});

test('can filter by slice', async ({ page }) => {
await page.getByText('short latin').click();
const grid = await page.locator('.grid').first();
await expect(grid.getByRole('button').first()).toContainText(
"That didn't seem to make sense to me; it certainly wasn't fair."
);
});

test('can filter by tag', async ({ page }) => {
await page.getByText('random tag').click();
const grid = await page.locator('.grid').first();
await expect(grid.getByRole('button').first()).toContainText(
'All I say to people is you treat us the way we treat you.'
);
test('can filter by tag', async ({ page }) => {
await page.getByText('random tag').click();
const grid = await page.locator('.grid').first();
await expect(grid.getByRole('button').first()).toContainText(
'All I say to people is you treat us the way we treat you.'
);
});
});

0 comments on commit d544242

Please sign in to comment.