A local-first personal finance app
:white_check_mark: (VRT) darkmode visual regression tests (#1860)
Matiss Janis Aboltinsaf666458d3e0
diff --git a/packages/desktop-client/e2e/accounts.test.js b/packages/desktop-client/e2e/accounts.test.jsindex 878e3c3542..45ca7096a2 100644--- a/packages/desktop-client/e2e/accounts.test.js+++ b/packages/desktop-client/e2e/accounts.test.js@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';import { ConfigurationPage } from './page-models/configuration-page';import { Navigation } from './page-models/navigation';-import screenshotConfig from './screenshot.config';test.describe('Accounts', () => {let page;@@ -35,7 +34,7 @@ test.describe('Accounts', () => {await expect(transaction.category).toHaveText('Starting Balances');await expect(transaction.debit).toHaveText('');await expect(transaction.credit).toHaveText('100.00');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('closes an account', async () => {@@ -45,10 +44,10 @@ test.describe('Accounts', () => {const modal = await accountPage.clickCloseAccount();await modal.selectTransferAccount('Vanguard 401k');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();await modal.closeAccount();await expect(accountPage.accountName).toHaveText('Closed: Roth IRA');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});});diff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.pngindex 6de2e744ef..1358b92826 100644Binary files a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.pngindex 861f3c8cc8..e87e4e7fd2 100644Binary files a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.pngnew file mode 100644index 0000000000..06f3377a2aBinary files /dev/null and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-4-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-4-chromium-linux.pngnew file mode 100644index 0000000000..3725305798Binary files /dev/null and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-1-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-1-chromium-linux.pngindex a186c1bbb8..1f4d1477c5 100644Binary files a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-1-chromium-linux.png and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-1-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-2-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-2-chromium-linux.pngnew file mode 100644index 0000000000..bd2f370a70Binary files /dev/null and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/budget.test.js b/packages/desktop-client/e2e/budget.test.jsindex f868c582a3..95404837f5 100644--- a/packages/desktop-client/e2e/budget.test.js+++ b/packages/desktop-client/e2e/budget.test.js@@ -1,7 +1,6 @@import { test, expect } from '@playwright/test';import { ConfigurationPage } from './page-models/configuration-page';-import screenshotConfig from './screenshot.config';test.describe('Budget', () => {let page;@@ -34,7 +33,7 @@ test.describe('Budget', () => {await expect(summary.getByText(/^Overspent in /)).toBeVisible();await expect(summary.getByText('Budgeted')).toBeVisible();await expect(summary.getByText('For Next Month')).toBeVisible();- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('transfer funds to another category', async () => {@@ -47,7 +46,7 @@ test.describe('Budget', () => {expect(await budgetPage.getBalanceForRow(2)).toEqual(currentFundsA + currentFundsB,);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('budget table is rendered', async () => {diff --git a/packages/desktop-client/e2e/budget.test.js-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-2-chromium-linux.png b/packages/desktop-client/e2e/budget.test.js-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-2-chromium-linux.pngnew file mode 100644index 0000000000..f04a3330ccBinary files /dev/null and b/packages/desktop-client/e2e/budget.test.js-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/budget.test.js-snapshots/Budget-transfer-funds-to-another-category-2-chromium-linux.png b/packages/desktop-client/e2e/budget.test.js-snapshots/Budget-transfer-funds-to-another-category-2-chromium-linux.pngnew file mode 100644index 0000000000..767f0f0688Binary files /dev/null and b/packages/desktop-client/e2e/budget.test.js-snapshots/Budget-transfer-funds-to-another-category-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js b/packages/desktop-client/e2e/mobile.test.jsindex d7fdda7cc4..fa53ecd515 100644--- a/packages/desktop-client/e2e/mobile.test.js+++ b/packages/desktop-client/e2e/mobile.test.js@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';import { ConfigurationPage } from './page-models/configuration-page';import { MobileNavigation } from './page-models/mobile-navigation';-import screenshotConfig from './screenshot.config';test.describe('Mobile', () => {let page;@@ -44,7 +43,7 @@ test.describe('Mobile', () => {'Water','Power',]);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('opens the accounts page and asserts on balances', async () => {@@ -54,7 +53,7 @@ test.describe('Mobile', () => {await expect(account.name).toHaveText('Ally Savings');await expect(account.balance).toHaveText('7,653.00');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('opens individual account page and checks that filtering is working', async () => {@@ -65,21 +64,21 @@ test.describe('Mobile', () => {expect(await accountPage.getBalance()).toBeGreaterThan(0);await expect(accountPage.noTransactionsFoundError).not.toBeVisible();- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();await accountPage.searchByText('nothing should be found');await expect(accountPage.noTransactionsFoundError).toBeVisible();await expect(accountPage.transactions).toHaveCount(0);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();await accountPage.searchByText('Kroger');await expect(accountPage.transactions).not.toHaveCount(0);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('creates a transaction via footer button', async () => {const transactionEntryPage = await navigation.goToTransactionEntryPage();- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();await expect(transactionEntryPage.header).toHaveText('New Transaction');@@ -96,14 +95,14 @@ test.describe('Mobile', () => {page.getByTestId('account-field'),'Ally Savings',);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();const accountPage = await transactionEntryPage.createTransaction();await expect(accountPage.transactions.nth(0)).toHaveText('KrogerClothing-12.34',);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('creates a transaction from `/accounts/:id` page', async () => {@@ -112,7 +111,7 @@ test.describe('Mobile', () => {const transactionEntryPage = await accountPage.clickCreateTransaction();await expect(transactionEntryPage.header).toHaveText('New Transaction');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();await transactionEntryPage.amountField.fill('12.34');await transactionEntryPage.fillField(@@ -133,7 +132,7 @@ test.describe('Mobile', () => {test('checks that settings page can be opened', async () => {const settingsPage = await navigation.goToSettingsPage();- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();const downloadPromise = page.waitForEvent('download');@@ -144,6 +143,6 @@ test.describe('Mobile', () => {expect(await download.suggestedFilename()).toMatch(/^\d{4}-\d{2}-\d{2}-.*.zip$/,);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});});diff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.pngindex 22186d8338..25eeeab52b 100644Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-3-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-3-chromium-linux.pngnew file mode 100644index 0000000000..46bf1b7912Binary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-4-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-4-chromium-linux.pngnew file mode 100644index 0000000000..3de1d44877Binary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-from-accounts-id-page-2-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-from-accounts-id-page-2-chromium-linux.pngnew file mode 100644index 0000000000..bba9c46663Binary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-from-accounts-id-page-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-2-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-2-chromium-linux.pngindex 65935ac142..a7777737ad 100644Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-2-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-3-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-3-chromium-linux.pngindex 2dd2bdc648..01f9ba542a 100644Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-3-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-4-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-4-chromium-linux.pngnew file mode 100644index 0000000000..0071e75e91Binary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-5-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-5-chromium-linux.pngnew file mode 100644index 0000000000..4f9429c520Binary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-5-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-6-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-6-chromium-linux.pngnew file mode 100644index 0000000000..fc388832edBinary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-6-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.pngnew file mode 100644index 0000000000..ae75ed2b3fBinary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.pngindex 061d910343..b4ac3b47f3 100644Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.pngindex f448161452..061d910343 100644Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-4-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-4-chromium-linux.pngnew file mode 100644index 0000000000..47f1dd9c98Binary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-5-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-5-chromium-linux.pngnew file mode 100644index 0000000000..3f9ef206aaBinary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-5-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-6-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-6-chromium-linux.pngnew file mode 100644index 0000000000..6f82bce4b3Binary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-6-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.pngnew file mode 100644index 0000000000..de102f9e23Binary files /dev/null and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/onboarding.test.js b/packages/desktop-client/e2e/onboarding.test.jsindex 98c5b28c08..78d5aa0a8f 100644--- a/packages/desktop-client/e2e/onboarding.test.js+++ b/packages/desktop-client/e2e/onboarding.test.js@@ -5,7 +5,6 @@ import { test, expect } from '@playwright/test';import { AccountPage } from './page-models/account-page';import { ConfigurationPage } from './page-models/configuration-page';import { Navigation } from './page-models/navigation';-import screenshotConfig from './screenshot.config';test.describe('Onboarding', () => {let page;@@ -26,10 +25,10 @@ test.describe('Onboarding', () => {test('checks the page visuals', async () => {await expect(configurationPage.heading).toHaveText('Where’s the server?');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();await configurationPage.clickOnNoServer();- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('creates a new budget file by importing YNAB4 budget', async () => {diff --git a/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-2-chromium-linux.pngindex ed62336bdf..d282442e86 100644Binary files a/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-3-chromium-linux.pngnew file mode 100644index 0000000000..ed62336bdfBinary files /dev/null and b/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-4-chromium-linux.png b/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-4-chromium-linux.pngnew file mode 100644index 0000000000..b3cea84a41Binary files /dev/null and b/packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/reports.test.js b/packages/desktop-client/e2e/reports.test.jsindex 54db8e5c48..1dc4b88047 100644--- a/packages/desktop-client/e2e/reports.test.js+++ b/packages/desktop-client/e2e/reports.test.js@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';import { ConfigurationPage } from './page-models/configuration-page';import { Navigation } from './page-models/navigation';-import screenshotConfig from './screenshot.config';test.describe('Reports', () => {let page;@@ -32,16 +31,16 @@ test.describe('Reports', () => {const reports = await reportsPage.getAvailableReportList();expect(reports).toEqual(['Net Worth', 'Cash Flow']);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('loads net worth graph and checks visuals', async () => {await reportsPage.goToNetWorthPage();- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('loads cash flow graph and checks visuals', async () => {await reportsPage.goToCashFlowPage();- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});});diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-2-chromium-linux.pngnew file mode 100644index 0000000000..624551b28eBinary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-2-chromium-linux.pngnew file mode 100644index 0000000000..6a691d9ff8Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-2-chromium-linux.pngnew file mode 100644index 0000000000..b7c63ff0e5Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/rules.test.js b/packages/desktop-client/e2e/rules.test.jsindex bec8a475e8..4de98db6df 100644--- a/packages/desktop-client/e2e/rules.test.js+++ b/packages/desktop-client/e2e/rules.test.js@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';import { ConfigurationPage } from './page-models/configuration-page';import { Navigation } from './page-models/navigation';-import screenshotConfig from './screenshot.config';test.describe('Rules', () => {let page;@@ -29,7 +28,7 @@ test.describe('Rules', () => {test('checks the page visuals', async () => {await rulesPage.searchFor('Dominion');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('creates a rule and makes sure it is applied when creating a transaction', async () => {@@ -53,7 +52,7 @@ test.describe('Rules', () => {const rule = rulesPage.getNthRule(0);await expect(rule.conditions).toHaveText(['payee is Fast Internet']);await expect(rule.actions).toHaveText(['set category to General']);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();const accountPage = await navigation.goToAccountPage('HSBC');@@ -66,6 +65,6 @@ test.describe('Rules', () => {await expect(transaction.payee).toHaveText('Fast Internet');await expect(transaction.category).toHaveText('General');await expect(transaction.debit).toHaveText('12.34');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});});diff --git a/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-checks-the-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-checks-the-page-visuals-2-chromium-linux.pngnew file mode 100644index 0000000000..33cc6dda9bBinary files /dev/null and b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-checks-the-page-visuals-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.pngindex 6eef921361..728f52cea8 100644Binary files a/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.pngnew file mode 100644index 0000000000..0f33f1f96aBinary files /dev/null and b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.png b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.pngnew file mode 100644index 0000000000..54d5d15803Binary files /dev/null and b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/schedules.test.js b/packages/desktop-client/e2e/schedules.test.jsindex 5935840465..770f0e6ad7 100644--- a/packages/desktop-client/e2e/schedules.test.js+++ b/packages/desktop-client/e2e/schedules.test.js@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';import { ConfigurationPage } from './page-models/configuration-page';import { Navigation } from './page-models/navigation';-import screenshotConfig from './screenshot.config';test.describe('Schedules', () => {let page;@@ -28,7 +27,7 @@ test.describe('Schedules', () => {});test('checks the page visuals', async () => {- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('creates a new schedule, posts the transaction and later completes it', async () => {@@ -43,11 +42,11 @@ test.describe('Schedules', () => {await expect(schedule.account).toHaveText('HSBC');await expect(schedule.amount).toHaveText('~25.00');await expect(schedule.status).toHaveText('Due');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();await schedulesPage.postNthSchedule(2);await expect(schedulesPage.getNthSchedule(2).status).toHaveText('Paid');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();// Go to transactions pageconst accountPage = await navigation.goToAccountPage('HSBC');@@ -77,7 +76,7 @@ test.describe('Schedules', () => {await expect(schedulesPage.getNthScheduleRow(4)).toHaveText('Show completed schedules',);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();// Schedules search shouldn't shrink with many schedulesfor (let i = 0; i < 15; i++) {@@ -87,6 +86,6 @@ test.describe('Schedules', () => {amount: 0,});}- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});});diff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-2-chromium-linux.pngnew file mode 100644index 0000000000..94505412d1Binary files /dev/null and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.pngindex 00d49fff88..1c75b1463d 100644Binary files a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.pngindex ec25977ca3..9be9b6f41c 100644Binary files a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.pngindex 6d48f2320f..0680cf4b2c 100644Binary files a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-5-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-5-chromium-linux.pngnew file mode 100644index 0000000000..d3d1af2a66Binary files /dev/null and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-5-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-6-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-6-chromium-linux.pngnew file mode 100644index 0000000000..600447e73aBinary files /dev/null and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-6-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-7-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-7-chromium-linux.pngnew file mode 100644index 0000000000..1366ec299aBinary files /dev/null and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-7-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-8-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-8-chromium-linux.pngnew file mode 100644index 0000000000..4b77c4ca07Binary files /dev/null and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-8-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/screenshot.config.js b/packages/desktop-client/e2e/screenshot.config.jsdeleted file mode 100644index 2debabf972..0000000000--- a/packages/desktop-client/e2e/screenshot.config.js+++ /dev/null@@ -1,6 +0,0 @@-export default function screenshotConfig(page) {- return {- // eslint-disable-next-line rulesdir/typography- mask: [page.locator('[data-vrt-mask="true"]')],- };-}diff --git a/packages/desktop-client/e2e/settings.test.js b/packages/desktop-client/e2e/settings.test.jsindex 0bcf3c00ab..bc8029eff4 100644--- a/packages/desktop-client/e2e/settings.test.js+++ b/packages/desktop-client/e2e/settings.test.js@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';import { ConfigurationPage } from './page-models/configuration-page';import { Navigation } from './page-models/navigation';-import screenshotConfig from './screenshot.config';test.describe('Settings', () => {let page;@@ -28,7 +27,7 @@ test.describe('Settings', () => {});test('checks the page visuals', async () => {- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('downloads the export of the budget', async () => {diff --git a/packages/desktop-client/e2e/settings.test.js-snapshots/Settings-checks-the-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/settings.test.js-snapshots/Settings-checks-the-page-visuals-2-chromium-linux.pngnew file mode 100644index 0000000000..73a467e0c6Binary files /dev/null and b/packages/desktop-client/e2e/settings.test.js-snapshots/Settings-checks-the-page-visuals-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js b/packages/desktop-client/e2e/transactions.test.jsindex b715d687c2..0fc9070ef1 100644--- a/packages/desktop-client/e2e/transactions.test.js+++ b/packages/desktop-client/e2e/transactions.test.js@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';import { ConfigurationPage } from './page-models/configuration-page';import { Navigation } from './page-models/navigation';-import screenshotConfig from './screenshot.config';test.describe('Transactions', () => {let page;@@ -28,7 +27,7 @@ test.describe('Transactions', () => {});test('checks the page visuals', async () => {- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test.describe('filters transactions', () => {@@ -39,12 +38,12 @@ test.describe('Transactions', () => {test('by date', async () => {const filterTooltip = await accountPage.filterBy('Date');- await expect(filterTooltip.page).toHaveScreenshot(screenshotConfig(page));+ await expect(filterTooltip.page).toMatchThemeScreenshots();// Open datepickerawait page.keyboard.press('Space');const datepicker = page.getByTestId('date-select-tooltip');- await expect(datepicker).toHaveScreenshot(screenshotConfig(page));+ await expect(datepicker).toMatchThemeScreenshots();// Select "is xxxxx"await datepicker.getByRole('button', { name: '20' }).click();@@ -52,16 +51,16 @@ test.describe('Transactions', () => {// Assert that there are no transactionsawait expect(accountPage.transactionTable).toHaveText('No transactions');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('by category', async () => {const filterTooltip = await accountPage.filterBy('Category');- await expect(filterTooltip.page).toHaveScreenshot(screenshotConfig(page));+ await expect(filterTooltip.page).toMatchThemeScreenshots();// Type in the autocomplete boxconst autocomplete = page.getByTestId('autocomplete');- await expect(autocomplete).toHaveScreenshot(screenshotConfig(page));+ await expect(autocomplete).toMatchThemeScreenshots();// Select the active itemawait page.getByRole('button', { name: 'Clothing' }).click();@@ -83,7 +82,7 @@ test.describe('Transactions', () => {await expect(accountPage.getNthTransaction(4).category).toHaveText('Clothing',);- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});});@@ -101,7 +100,7 @@ test.describe('Transactions', () => {await expect(transaction.category).toHaveText('Food');await expect(transaction.debit).toHaveText('12.34');await expect(transaction.credit).toHaveText('');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});test('creates a split test transaction', async () => {@@ -140,6 +139,6 @@ test.describe('Transactions', () => {await expect(thirdTransaction.category).toHaveText('Categorize');await expect(thirdTransaction.debit).toHaveText('111.11');await expect(thirdTransaction.credit).toHaveText('');- await expect(page).toHaveScreenshot(screenshotConfig(page));+ await expect(page).toMatchThemeScreenshots();});});diff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-2-chromium-linux.pngnew file mode 100644index 0000000000..21988bb438Binary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-2-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-2-chromium-linux.pngnew file mode 100644index 0000000000..0ccdfee7d9Binary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-2-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-2-chromium-linux.pngnew file mode 100644index 0000000000..87c333ea39Binary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-2-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-2-chromium-linux.pngindex 06acef3e54..9c8cd497cf 100644Binary files a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-2-chromium-linux.png and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-3-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-3-chromium-linux.pngindex aa59979a25..06acef3e54 100644Binary files a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-3-chromium-linux.png and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-4-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-4-chromium-linux.pngnew file mode 100644index 0000000000..114f554adaBinary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-5-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-5-chromium-linux.pngnew file mode 100644index 0000000000..02b670d92aBinary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-5-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-6-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-6-chromium-linux.pngnew file mode 100644index 0000000000..3dede0758dBinary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-6-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-2-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-2-chromium-linux.pngindex a5b72beb8d..3198001481 100644Binary files a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-2-chromium-linux.png and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-3-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-3-chromium-linux.pngindex 7654389042..95df43d212 100644Binary files a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-3-chromium-linux.png and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-4-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-4-chromium-linux.pngnew file mode 100644index 0000000000..45adce6f41Binary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-4-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-5-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-5-chromium-linux.pngnew file mode 100644index 0000000000..0715fc33d7Binary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-5-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-6-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-6-chromium-linux.pngnew file mode 100644index 0000000000..b6b8dfd030Binary files /dev/null and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-6-chromium-linux.png differdiff --git a/packages/desktop-client/playwright.config.js b/packages/desktop-client/playwright.config.jsindex 87b854e79a..412a7ac28f 100644--- a/packages/desktop-client/playwright.config.js+++ b/packages/desktop-client/playwright.config.js@@ -1,17 +1,45 @@import { expect, defineConfig } from '@playwright/test';-// Disable screenshot assertions in regular e2e tests;-// only enable them when doing VRT tests-if (!process.env.VRT) {- expect.extend({- toHaveScreenshot() {+expect.extend({+ async toMatchThemeScreenshots(locator) {+ // Disable screenshot assertions in regular e2e tests;+ // only enable them when doing VRT tests+ if (!process.env.VRT) {return {message: () => 'passed',pass: true,};- },- });-}+ }++ const config = {+ // eslint-disable-next-line rulesdir/typography+ mask: [locator.locator('[data-vrt-mask="true"]')],+ };++ // Check lightmode+ const lightmode = await expect(locator).toHaveScreenshot(config);++ if (lightmode && !lightmode.pass) {+ return lightmode;+ }++ // Switch to darkmode and check+ await locator.evaluate(() => window.Actual.setTheme('dark'));+ const darkmode = await expect(locator).toHaveScreenshot(config);++ // Assert on+ if (darkmode && !darkmode.pass) {+ return darkmode;+ }++ // Switch back to lightmode+ await locator.evaluate(() => window.Actual.setTheme('light'));+ return {+ message: () => 'pass',+ pass: true,+ };+ },+});// eslint-disable-next-line import/no-unused-modulesexport default defineConfig({diff --git a/packages/desktop-client/src/browser-preload.browser.js b/packages/desktop-client/src/browser-preload.browser.jsindex 35b714c388..2fa3e0fae5 100644--- a/packages/desktop-client/src/browser-preload.browser.js+++ b/packages/desktop-client/src/browser-preload.browser.js@@ -128,6 +128,8 @@ global.Actual = {getServerSocket: async () => {return worker;},++ setTheme: () => {},};document.addEventListener('keydown', e => {diff --git a/packages/desktop-client/src/global-events.js b/packages/desktop-client/src/global-events.jsindex 258e13ea21..1cc54f8766 100644--- a/packages/desktop-client/src/global-events.js+++ b/packages/desktop-client/src/global-events.js@@ -14,6 +14,10 @@ export function handleGlobalEvents(actions, store) {// to update.});+ global.Actual.setTheme = theme => {+ actions.saveGlobalPrefs({ theme });+ };+listen('server-error', info => {actions.addGenericErrorNotification();});diff --git a/packages/desktop-electron/preload.js b/packages/desktop-electron/preload.jsindex c35fbf78d2..7bfb4a37c5 100644--- a/packages/desktop-electron/preload.js+++ b/packages/desktop-electron/preload.js@@ -54,4 +54,6 @@ contextBridge.exposeInMainWorld('Actual', {getServerSocket: () => {return socketPromise;},++ setTheme: () => {},});diff --git a/upcoming-release-notes/1860.md b/upcoming-release-notes/1860.mdnew file mode 100644index 0000000000..980838e742--- /dev/null+++ b/upcoming-release-notes/1860.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [MatissJanis]+---++Added darkmode VRT (screenshot) tests