fix: add prefer-dom-node-dataset rule (#5107)

This commit is contained in:
LongYinan
2023-11-29 04:43:35 +00:00
parent 923844f302
commit 123f091e5b
9 changed files with 13 additions and 22 deletions

View File

@@ -114,9 +114,7 @@ test('clientBorder value should disable by default on window', async ({
test('app theme', async ({ page, electronApp }) => {
const root = page.locator('html');
{
const themeMode = await root.evaluate(element =>
element.getAttribute('data-theme')
);
const themeMode = await root.evaluate(element => element.dataset.theme);
expect(themeMode).toBe('light');
const theme = await electronApp.evaluate(({ nativeTheme }) => {
@@ -131,9 +129,7 @@ test('app theme', async ({ page, electronApp }) => {
await page.getByTestId('appearance-panel-trigger').click();
await page.waitForTimeout(50);
await page.getByTestId('dark-theme-trigger').click();
const themeMode = await root.evaluate(element =>
element.getAttribute('data-theme')
);
const themeMode = await root.evaluate(element => element.dataset.theme);
expect(themeMode).toBe('dark');
const theme = await electronApp.evaluate(({ nativeTheme }) => {
return nativeTheme.shouldUseDarkColors ? 'dark' : 'light';