Skip to content

Commit 15c9e44

Browse files
Moon KyongMoon Kyong
authored andcommitted
Add tests for the divider change
1 parent 58f457a commit 15c9e44

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

special-pages/pages/history/integration-tests/history.page.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,15 @@ export class HistoryTestPage {
601601
const rgb = `rgb(${[r, g, b].join(', ')})`;
602602
await expect(this.page.locator('[data-layout-mode="normal"]')).toHaveCSS('background-color', rgb, { timeout: 50 });
603603
}
604+
605+
async lastItemDividerHasColor({ rgb }) {
606+
const lastItem = this.sidebar().locator('.Sidebar_item').last();
607+
const borderTopColor = await lastItem.evaluate((el) => {
608+
const before = window.getComputedStyle(el, '::before');
609+
return before.borderTopColor;
610+
});
611+
expect(borderTopColor).toBe(rgb);
612+
}
604613
}
605614

606615
/**

special-pages/pages/history/integration-tests/history.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,20 @@ test.describe('history', () => {
263263
await hp.hasBackgroundColor({ hex: '#27282A' });
264264
});
265265
});
266+
267+
test.describe('last item divider default colors', () => {
268+
test('divider color - light', async ({ page }, workerInfo) => {
269+
const hp = HistoryTestPage.create(page, workerInfo).withEntries(5);
270+
await hp.openPage({});
271+
// rgba(0, 0, 0, 0.06) is --color-black-at-6 var value
272+
await hp.lastItemDividerHasColor({ rgb: 'rgba(0, 0, 0, 0.06)' });
273+
});
274+
test('divider color - dark', async ({ page }, workerInfo) => {
275+
const hp = HistoryTestPage.create(page, workerInfo).withEntries(5);
276+
await hp.openPage({});
277+
await hp.darkMode();
278+
// rgba(255, 255, 255, 0.06) is --color-white-at-6 var value
279+
await hp.lastItemDividerHasColor({ rgb: 'rgba(255, 255, 255, 0.06)' });
280+
});
281+
});
266282
});

0 commit comments

Comments
 (0)