Skip to content

A local-first personal finance app

Command bar VRTs (#5591)

Michael Clark96bfc6933267
diff --git a/packages/desktop-client/e2e/command-bar.test.ts b/packages/desktop-client/e2e/command-bar.test.ts
new file mode 100644
index 0000000000..57500031d4
--- /dev/null
+++ b/packages/desktop-client/e2e/command-bar.test.ts
@@ -0,0 +1,77 @@
+import { type Page } from '@playwright/test';
+
+import { expect, test } from './fixtures';
+import { ConfigurationPage } from './page-models/configuration-page';
+
+test.describe('Command bar', () => {
+ let page: Page;
+ let configurationPage: ConfigurationPage;
+
+ test.beforeAll(async ({ browser }) => {
+ page = await browser.newPage();
+ configurationPage = new ConfigurationPage(page);
+
+ await page.goto('/');
+ await configurationPage.createTestFile();
+
+ // Move mouse to corner of the screen;
+ // sometimes the mouse hovers on a budget element thus rendering an input box
+ // and this breaks screenshot tests
+ await page.mouse.move(0, 0);
+
+ // ensure page is loaded
+ await expect(page.getByTestId('budget-table')).toBeVisible();
+ await expect(page.getByRole('button', { name: 'Add group' })).toBeVisible({
+ timeout: 10000,
+ });
+ });
+
+ test.afterAll(async () => {
+ await page.close();
+ });
+
+ test('Check the command bar visuals', async () => {
+ // Open the command bar
+ await page.keyboard.press('ControlOrMeta+k');
+ const commandBar = page.getByRole('combobox', {
+ name: 'Command Bar',
+ });
+
+ await expect(commandBar).toBeVisible();
+ await expect(page).toMatchThemeScreenshots();
+
+ // Close the command bar
+ await page.keyboard.press('Escape');
+ await expect(commandBar).not.toBeVisible();
+ });
+
+ test('Check the command bar search works correctly', async () => {
+ await page.keyboard.press('ControlOrMeta+k');
+
+ const commandBar = page.getByRole('combobox', {
+ name: 'Command Bar',
+ });
+
+ await expect(commandBar).toBeVisible();
+ await expect(commandBar).toHaveValue('');
+
+ // Search and navigate to reports
+ await commandBar.fill('reports');
+ await page.keyboard.press('Enter');
+ await expect(page.getByTestId('reports-page')).toBeVisible();
+ await expect(page.getByText('Loading reports...')).not.toBeVisible(); // wait for screen to load
+
+ // Navigate to schedule page
+ await page.keyboard.press('ControlOrMeta+k');
+ await page.keyboard.press('ArrowDown');
+ await page.keyboard.press('ArrowDown'); // Select second suggestion - Schedules
+ await expect(page).toMatchThemeScreenshots();
+
+ await page.keyboard.press('Enter');
+ await expect(
+ page.getByRole('button', {
+ name: 'Add new schedule',
+ }),
+ ).toBeVisible();
+ });
+});
diff --git a/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-1-chromium-linux.png b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-1-chromium-linux.png
new file mode 100644
index 0000000000..46b4d6a0ab
Binary files /dev/null and b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-2-chromium-linux.png b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-2-chromium-linux.png
new file mode 100644
index 0000000000..0c913efc95
Binary files /dev/null and b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-3-chromium-linux.png b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-3-chromium-linux.png
new file mode 100644
index 0000000000..35957fc64c
Binary files /dev/null and b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-search-works-correctly-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-1-chromium-linux.png
new file mode 100644
index 0000000000..7787486e05
Binary files /dev/null and b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-2-chromium-linux.png
new file mode 100644
index 0000000000..abe66afa56
Binary files /dev/null and b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-3-chromium-linux.png
new file mode 100644
index 0000000000..577374c523
Binary files /dev/null and b/packages/desktop-client/e2e/command-bar.test.ts-snapshots/Command-bar-Check-the-command-bar-visuals-3-chromium-linux.png differ
diff --git a/upcoming-release-notes/5591.md b/upcoming-release-notes/5591.md
new file mode 100644
index 0000000000..4a97244736
--- /dev/null
+++ b/upcoming-release-notes/5591.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [MikesGlitch]
+---
+
+Added Command bar VRT's