cycles-quartz/examples/transfers/frontend/tests/e2e/auth.spec.ts
Daniel Gushchyan 14a6913632
refactor: refactor repo as standard rust monorepo (#222)
Co-authored-by: hu55a1n1 <sufialhussaini@gmail.com>
2024-09-30 23:33:22 +04:00

40 lines
1.1 KiB
TypeScript

import { routes } from '@/config/routes'
import test from './fixtures'
import { connectWallet } from './helpers/connectWalet'
import { setSeedPhrase } from './helpers/setSeedPhrase'
const { dashboard, landing, seed } = routes
test.describe('Auth', () => {
test('can go nowhere but landing page without a wallet', async ({ page }) => {
await page.goto(seed)
await page.goto(dashboard)
await test
.expect(page.getByRole('button', { name: /connect/i }))
.toBeVisible()
})
test('can go nowhere but seed page without a seed phrase', async ({
context,
page,
}) => {
await connectWallet({ context, page })
await page.goto(landing)
await page.goto(dashboard)
await test.expect(page.getByText(/recovery seed phrase/i)).toBeVisible()
})
test('cannot go to anon pages once fully logged in', async ({
context,
page,
}) => {
await connectWallet({ context, page })
await setSeedPhrase({ page })
await page.goto(landing)
await page.goto(seed)
await test.expect(page.getByText(/balance:/i)).toBeVisible()
})
})