From 3192aa6981013d77c5d2e117a6661634b55280ff Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 17 Mar 2024 12:11:43 +0100 Subject: [PATCH 1/2] Fix broken server dropdown menu when auto-connect is enabled --- CHANGELOG.md | 4 ++-- src/servers/ManageServersRowDropdown.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2b01b5c..1b88cfea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## [4.1.0] - 2024-03-17 ### Added * [#1079](https://github.com/shlinkio/shlink-web-client/issues/1079) Add support Shlink 4.0.0. * [shlink-web-component#271](https://github.com/shlinkio/shlink-web-component/issues/271) Add support for redirect rules when consuming Shlink 4.0.0. @@ -22,7 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * [shlink-web-component#276](https://github.com/shlinkio/shlink-web-component/issues/276) Drop support for Shlink older than 3.3.0 ### Fixed -* *Nothing* +* [#1084](https://github.com/shlinkio/shlink-web-client/issues/1084) Fix broken server dropdown menu when auto-connect is enabled. ## [4.0.1] - 2024-02-01 diff --git a/src/servers/ManageServersRowDropdown.tsx b/src/servers/ManageServersRowDropdown.tsx index e9e1c9db..188f2780 100644 --- a/src/servers/ManageServersRowDropdown.tsx +++ b/src/servers/ManageServersRowDropdown.tsx @@ -37,7 +37,7 @@ const ManageServersRowDropdown: FCWithDeps + Connect From 36e2ba59c9dff9fa0c353b2bc8c02c6793e4c5d8 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 17 Mar 2024 12:21:45 +0100 Subject: [PATCH 2/2] 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`] = ` +
+ +
+`;