From 36e2ba59c9dff9fa0c353b2bc8c02c6793e4c5d8 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 17 Mar 2024 12:21:45 +0100 Subject: [PATCH] Add test to cover server dropdown UI for auto-connect --- .../servers/ManageServersRowDropdown.test.tsx | 5 + .../ManageServersRowDropdown.test.tsx.snap | 287 ++++++++++++++++++ 2 files changed, 292 insertions(+) create mode 100644 test/servers/__snapshots__/ManageServersRowDropdown.test.tsx.snap diff --git a/test/servers/ManageServersRowDropdown.test.tsx b/test/servers/ManageServersRowDropdown.test.tsx index 88f11ef8..1563e7c1 100644 --- a/test/servers/ManageServersRowDropdown.test.tsx +++ b/test/servers/ManageServersRowDropdown.test.tsx @@ -67,4 +67,9 @@ describe('', () => { expect(screen.getByText('DeleteServerModal [OPEN]')).toBeInTheDocument(); expect(screen.queryByText('DeleteServerModal [CLOSED]')).not.toBeInTheDocument(); }); + + it.each([[true], [false]])('renders expected size and icon', (autoConnect) => { + const { container } = setUp(autoConnect); + expect(container).toMatchSnapshot(); + }); }); diff --git a/test/servers/__snapshots__/ManageServersRowDropdown.test.tsx.snap b/test/servers/__snapshots__/ManageServersRowDropdown.test.tsx.snap new file mode 100644 index 00000000..c8b97ad4 --- /dev/null +++ b/test/servers/__snapshots__/ManageServersRowDropdown.test.tsx.snap @@ -0,0 +1,287 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[` > renders expected size and icon 1`] = ` +
+ +
+`; + +exports[` > renders expected size and icon 2`] = ` +
+ +
+`;