Skip to content

Commit 4b31c88

Browse files
committed
rewrite test for better linux support and easier readibility
1 parent 56085e8 commit 4b31c88

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

tests/integration/playwright/tests/html-themes.spec.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,24 @@ test('border color from default theme does not change (like disappearing)', asyn
4343
await page.goto('./html/default-border-color.html');
4444

4545
// callout border
46-
for (const side of ['bottom', 'right', 'top']) {
47-
await checkBorderProperties(page.getByText('Note Content'), side, asRGB(0, 0, 0, 0.1), '1px');
48-
}
46+
const calloutNote = page.locator('div.callout-note');
47+
const calloutBorderColor = asRGB(0, 0, 0, 0.1);
48+
await checkBorderProperties(calloutNote, 'bottom', calloutBorderColor, '1px');
49+
await checkBorderProperties(calloutNote, 'right', calloutBorderColor, '1px');
50+
await checkBorderProperties(calloutNote, 'top', calloutBorderColor, '1px');
4951

5052
// tabset border
51-
for (const side of ['bottom', 'right', 'left']) {
52-
await checkBorderProperties(
53-
page.getByText('This is a playground for Quarto. Another Tab'),
54-
side,
55-
asRGB(225, 225, 226),
56-
'1px'
57-
);
58-
}
53+
const tabContent = page.locator('div.tab-content');
54+
const tabBorderColor = asRGB(225, 225, 226);
55+
await checkBorderProperties(tabContent, 'bottom', tabBorderColor, '1px');
56+
await checkBorderProperties(tabContent, 'right', tabBorderColor, '1px');
57+
await checkBorderProperties(tabContent, 'left', tabBorderColor, '1px');
58+
59+
const activeNavLink = page.locator('li.nav-item > a.nav-link.active');
60+
await checkBorderProperties(activeNavLink, 'top', tabBorderColor, '1px');
61+
await checkBorderProperties(activeNavLink, 'right', tabBorderColor, '1px');
62+
await checkBorderProperties(activeNavLink, 'left', tabBorderColor, '1px');
63+
await checkBorderProperties(activeNavLink, 'bottom', asRGB(255, 255, 255), '1px');
5964

6065
// table borders
6166
const table = page.locator('table');

0 commit comments

Comments
 (0)