test(admin): passing custom css

This commit is contained in:
Jacob Fletcher
2024-04-03 18:03:10 -04:00
parent 8f4b8f5826
commit 8313cf34a6
4 changed files with 18 additions and 18 deletions

View File

@@ -0,0 +1,8 @@
#custom-css {
font-family: monospace;
background-image: url('/placeholder.png');
}
#custom-css::after {
content: 'custom-css';
}

View File

@@ -643,6 +643,16 @@ describe('admin', () => {
})
})
describe('Custom CSS', () => {
test('should see custom css in admin UI', async () => {
await page.goto(postsUrl.admin)
await page.waitForURL(postsUrl.admin)
await openNav(page)
const navControls = page.locator('#custom-css')
await expect(navControls).toHaveCSS('font-family', 'monospace')
})
})
describe('list view', () => {
const tableRowLocator = 'table > tbody > tr'
@@ -1182,15 +1192,6 @@ describe('admin', () => {
})
})
describe('custom css', () => {
test('should see custom css in admin UI', async () => {
await page.goto(postsUrl.admin)
await openNav(page)
const navControls = page.locator('#custom-css')
await expect(navControls).toHaveCSS('font-family', 'monospace')
})
})
// TODO: Troubleshoot flaky suite
describe('sorting', () => {
beforeEach(async () => {

View File

@@ -1,8 +0,0 @@
#custom-css {
font-family: monospace;
background-image: url('/placeholder.png');
}
#custom-css::after {
content: 'custom-css';
}

View File

@@ -103,7 +103,6 @@ export async function openNav(page: Page): Promise<void> {
if (await page.locator('.template-default.template-default--nav-open').isVisible()) return
// playwright: get first element with .nav-toggler which is VISIBLE (not hidden), could be 2 elements with .nav-toggler on mobile and desktop but only one is visible
await page.locator('.nav-toggler >> visible=true').click()
await expect(page.locator('.template-default.template-default--nav-open')).toBeVisible()
}