mirror of
https://github.com/codex-storage/codex-marketplace-ui.git
synced 2025-02-23 21:28:26 +00:00
Add tests for onboarding
This commit is contained in:
parent
37c0df0888
commit
7ec8262953
19
e2e/onboarding.spec.ts
Normal file
19
e2e/onboarding.spec.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('onboarding steps', async ({ page }) => {
|
||||
await page.context().setOffline(false)
|
||||
await page.goto('/');
|
||||
await expect(page.locator('#root')).toContainText('Network connected');
|
||||
await page.locator('a').nth(2).click();
|
||||
await page.context().setOffline(true)
|
||||
await expect(page.locator('#root')).toContainText('Network disconnected');
|
||||
await page.getByLabel('Display name').click();
|
||||
await page.getByLabel('Display name').fill('Arnaud');
|
||||
await page.locator('a').click();
|
||||
await page.locator('div').filter({ hasText: /^Internet connectionStatus indicator for the Internet\.$/ }).first().click();
|
||||
await expect(page.getByTestId("network").locator(".onboarding-check-icon--valid")).not.toBeInViewport()
|
||||
await expect(page.getByTestId("network").locator(".onboarding-check-icon--invalid")).toBeInViewport()
|
||||
await page.context().setOffline(false)
|
||||
await expect(page.getByTestId("network").locator(".onboarding-check-icon--valid")).toBeInViewport()
|
||||
await expect(page.getByTestId("network").locator(".onboarding-check-icon--invalid")).not.toBeInViewport()
|
||||
});
|
@ -59,6 +59,7 @@ export function OnBoardingStepThree({ online, onStepValid }: Props) {
|
||||
<ButtonIcon Icon={Save} onClick={onSave}></ButtonIcon>
|
||||
</div>
|
||||
<div
|
||||
data-testid="network"
|
||||
className={classnames(
|
||||
["onboarding-check"],
|
||||
["onboarding-check--valid", online]
|
||||
|
Loading…
x
Reference in New Issue
Block a user