-
-
Notifications
You must be signed in to change notification settings - Fork 142
/
Copy pathmonorepo.spec.ts
34 lines (30 loc) · 1.09 KB
/
monorepo.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { expect } from '@playwright/test';
import { test, prepareStandaloneSetup } from './utils.js';
const startApp = prepareStandaloneSetup('monorepo');
for (const mode of ['DEV', 'PRD'] as const) {
for (const packageManager of ['npm', 'pnpm', 'yarn'] as const) {
test.describe(`${packageManager} monorepo: ${mode}`, () => {
let port: number;
let stopApp: () => Promise<void>;
test.beforeAll(async () => {
({ port, stopApp } = await startApp(
mode,
packageManager,
'packages/waku-project',
));
});
test.afterAll(async () => {
await stopApp();
});
test('renders the home page', async ({ page }) => {
await page.goto(`http://localhost:${port}`);
await expect(page.getByTestId('header')).toHaveText('Waku');
// it should show context value from provider correctly
await page.waitForSelector('[data-testid="context-consumer-mounted"]');
await expect(page.getByTestId('context-consumer-value')).toHaveText(
'provider value',
);
});
});
}
}