👽 Configures frontend tests suit

This commit is contained in:
Rune Harlyk
2024-05-03 15:42:52 +02:00
committed by Rune Harlyk
parent 00381579db
commit 2b4d196e7c
14 changed files with 349 additions and 102 deletions
+24
View File
@@ -0,0 +1,24 @@
import { expect, test } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('/');
await page.route('**/api/features', (route) =>
route.fulfill({
status: 200,
body: JSON.stringify({})
})
);
await expect(page).toHaveTitle(/Spot micro controller/);
});
test('index page has expected h1', async ({ page }) => {
await page.goto('/');
await page.route('**/api/features', (route) =>
route.fulfill({
status: 200,
body: JSON.stringify({})
})
);
await expect(page.getByRole('heading', { name: 'Spot micro controller' }).first()).toBeVisible();
});
-6
View File
@@ -1,6 +0,0 @@
import { expect, test } from '@playwright/test';
test('index page has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Welcome to SvelteKit' })).toBeVisible();
});
@@ -3,7 +3,7 @@ import { throttler } from '../../src/lib/utilities/buffer-utilities';
describe('throttler', () => {
let throttleInstance: throttler;
let callback;
let callback: Function;
beforeEach(() => {
vitest.useFakeTimers();