Skip to content

Commit

Permalink
chore: try to fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
hannoeru committed Jun 30, 2022
1 parent 22758c7 commit 4730294
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/e2e/solid.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,42 @@ describe('solid e2e test', () => {
const getUrl = (path: string) => `http://localhost:${server.config.server.port}${path}`

test('/blog/today have content', async() => {
await page.goto(getUrl('/blog/today'))
await page.goto(getUrl('/blog/today'), { waitUntil: 'networkidle' })
const text = await page.locator('body > div').textContent()
expect(text?.trim()).toBe('blog/today/index.tsx')
})

test('/blog/today/xxx - nested cache all', async() => {
await page.goto(getUrl('/blog/today/xxx'))
await page.goto(getUrl('/blog/today/xxx'), { waitUntil: 'networkidle' })
const text = await page.locator('body > div').textContent()
expect(text?.trim()).toBe('blog/today ...all route')
})

test('/xxx/xxx - cache all route', async() => {
await page.goto(getUrl('/xxx/xxx'))
await page.goto(getUrl('/xxx/xxx'), { waitUntil: 'networkidle' })
const text = await page.locator('body > div').textContent()
expect(text?.trim()).toBe('...all route')
})

test('/about/1b234bk12b3/more deep nested dynamic route', async() => {
await page.goto(getUrl('/about/1b234bk12b3/more'))
await page.goto(getUrl('/about/1b234bk12b3/more'), { waitUntil: 'networkidle' })
const text = await page.locator('div.deep-more').textContent()
expect(text?.trim()).toBe('deep nested: about/[id]/more.tsx')
})

test('/features/dashboard custom routes folder', async() => {
await page.goto(getUrl('/features/dashboard'))
await page.goto(getUrl('/features/dashboard'), { waitUntil: 'networkidle' })
const text = await page.locator('body > div > p >> nth=0').textContent()
expect(text?.trim()).toBe('features/dashboard/pages/dashboard.tsx')
})

test('hmr - dynamic add /test route', async() => {
await page.goto(getUrl('/'))
await page.goto(getUrl('/'), { waitUntil: 'networkidle' })

await copyFile(srcPath, distPath)

await page.goto(getUrl('/'), { waitUntil: 'networkidle' })
await page.goto(getUrl('/test'))
await page.goto(getUrl('/test'), { waitUntil: 'networkidle' })

const text = await page.locator('body > div').textContent()
expect(text?.trim()).toBe('this is test file')
Expand Down

0 comments on commit 4730294

Please sign in to comment.