From 9a64173eba802dd9ce50aedac3b247e1691faf91 Mon Sep 17 00:00:00 2001 From: Sam Van Campenhout Date: Wed, 20 Mar 2024 17:11:02 +0100 Subject: [PATCH] Remove the icon tests from the `AuAccordion` component These tests are frail since they depend on the icon setup and don't really test if it actually works. Ideally we would test this with some kind of visual regression testing setup, but for now we'll just remove the tests. --- addon/components/au-accordion.gts | 23 ++------ .../components/au-accordion-test.gts | 56 ------------------- 2 files changed, 6 insertions(+), 73 deletions(-) diff --git a/addon/components/au-accordion.gts b/addon/components/au-accordion.gts index 1f32c4bb6..b7f4b3b6c 100644 --- a/addon/components/au-accordion.gts +++ b/addon/components/au-accordion.gts @@ -101,23 +101,12 @@ export default class AuAccordion extends Component { - {{#if this.isOpen}} - - {{else}} - - {{/if}} + {{#if this.isOpen}} diff --git a/tests/integration/components/au-accordion-test.gts b/tests/integration/components/au-accordion-test.gts index 5f5ea089d..0d5bdf075 100644 --- a/tests/integration/components/au-accordion-test.gts +++ b/tests/integration/components/au-accordion-test.gts @@ -9,8 +9,6 @@ const ACCORDION = { CONTENT: '[data-test-accordion-content]', BUTTON: '[data-test-accordion-button]', SUBTITLE: '[data-test-accordion-subtitle]', - ICON_OPEN: '[data-test-accordion-icon-open]', - ICON_CLOSED: '[data-test-accordion-icon-closed]', LOADER: '[data-test-accordion-loader]', }; @@ -87,60 +85,6 @@ module('Integration | Component | au-accordion', function (hooks) { assert.dom(ACCORDION.BUTTON).exists().hasText('Foo button'); }); - test('it shows a different icon depending on the open state', async function (assert) { - await render( - , - ); - - assert.dom(ACCORDION.ICON_OPEN).doesNotExist(); - assert.dom(ACCORDION.ICON_CLOSED).exists(); - - await toggleAccordion(); - assert.dom(ACCORDION.ICON_OPEN).exists(); - assert.dom(ACCORDION.ICON_CLOSED).doesNotExist(); - }); - - test('it supports choosing different icons', async function (assert) { - const state = new TestState(); - await render( - , - ); - - assert - .dom(ACCORDION.ICON_CLOSED) - .hasAttribute('data-test-accordion-icon-closed', 'nav-right'); - - state.iconClosed = 'other-closed-icon'; - await settled(); - - assert - .dom(ACCORDION.ICON_CLOSED) - .hasAttribute('data-test-accordion-icon-closed', 'other-closed-icon'); - - await toggleAccordion(); - assert - .dom(ACCORDION.ICON_OPEN) - .hasAttribute('data-test-accordion-icon-open', 'nav-down'); - - state.iconOpen = 'other-open-icon'; - await settled(); - - assert - .dom(ACCORDION.ICON_OPEN) - .hasAttribute('data-test-accordion-icon-open', 'other-open-icon'); - }); - test('it can show a loading indicator instead of content', async function (assert) { const state = new TestState(); state.isLoading = true;