From 7d86215f836fa6bb29e715e4589d7cc2a92372a1 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Mon, 11 May 2026 19:01:16 -0300 Subject: [PATCH] test(front): align default-state card assertions Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- src/tests/components/GatewayInstanceCard.spec.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/tests/components/GatewayInstanceCard.spec.ts b/src/tests/components/GatewayInstanceCard.spec.ts index 02daf883..fbda00f9 100644 --- a/src/tests/components/GatewayInstanceCard.spec.ts +++ b/src/tests/components/GatewayInstanceCard.spec.ts @@ -76,11 +76,11 @@ describe('GatewayInstanceCard', () => { expect(wrapper.text()).toContain('My Signal Config') }) - it('shows the "Default" badge when the instance is the default', () => { + it('marks the card with default styling when the instance is default', () => { const wrapper = mount(GatewayInstanceCard, { props: { instance: makeInstance({ default: true }), fields }, }) - expect(wrapper.text()).toContain('tr:Default') + expect(wrapper.classes()).toContain('gateway-instance-card--default') }) it('does not show the "Default" badge for non-default instances', () => { @@ -104,17 +104,14 @@ describe('GatewayInstanceCard', () => { expect(wrapper.text()).toContain('tr:Incomplete') }) - it('hides the "Set as default" button and shows a disabled star for the default instance', () => { + it('hides the "Set as default" button and shows default indicator action for default instance', () => { const wrapper = mount(GatewayInstanceCard, { props: { instance: makeInstance({ default: true }), fields }, }) const buttons = wrapper.findAll('button') - const titlesAndDisabled = buttons.map((b) => ({ - title: b.attributes('title'), - disabled: b.attributes('disabled'), - })) - expect(titlesAndDisabled.some((b) => b.title === 'tr:This is the default instance' && b.disabled !== undefined)).toBe(true) - expect(titlesAndDisabled.some((b) => b.title === 'tr:Set as default')).toBe(false) + const titles = buttons.map((b) => b.attributes('title')) + expect(titles).toContain('tr:This is the default instance') + expect(titles).not.toContain('tr:Set as default') }) it('shows the "Set as default" button for non-default instances', () => {