From 8dedb4f5732922da9001f28a459519026ddf9202 Mon Sep 17 00:00:00 2001 From: Davide Mininni Date: Wed, 3 Apr 2024 10:23:00 +0200 Subject: [PATCH] fix: review --- .../autocomplete-grid-option.spec.snap.js | 32 ++++++++++++++++ .../autocomplete-grid-option.spec.ts | 8 ++-- .../autocomplete-grid.spec.ts | 38 +++++++++---------- 3 files changed, 54 insertions(+), 24 deletions(-) diff --git a/src/components/autocomplete-grid/autocomplete-grid-option/__snapshots__/autocomplete-grid-option.spec.snap.js b/src/components/autocomplete-grid/autocomplete-grid-option/__snapshots__/autocomplete-grid-option.spec.snap.js index a71da0b9f16..86b060974f1 100644 --- a/src/components/autocomplete-grid/autocomplete-grid-option/__snapshots__/autocomplete-grid-option.spec.snap.js +++ b/src/components/autocomplete-grid/autocomplete-grid-option/__snapshots__/autocomplete-grid-option.spec.snap.js @@ -64,3 +64,35 @@ snapshots["sbb-autocomplete-grid-option default A11y tree Firefox"] = `; /* end snapshot sbb-autocomplete-grid-option default A11y tree Firefox */ +snapshots["sbb-autocomplete-grid-option A11y tree Chrome"] = +`

+ { + "role": "WebArea", + "name": "", + "children": [ + { + "role": "text", + "name": "Option 1" + } + ] +} +

+`; +/* end snapshot sbb-autocomplete-grid-option A11y tree Chrome */ + +snapshots["sbb-autocomplete-grid-option A11y tree Firefox"] = +`

+ { + "role": "document", + "name": "", + "children": [ + { + "role": "text leaf", + "name": "Option 1" + } + ] +} +

+`; +/* end snapshot sbb-autocomplete-grid-option A11y tree Firefox */ + diff --git a/src/components/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.spec.ts b/src/components/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.spec.ts index 121bb932bf9..c29163bb1c5 100644 --- a/src/components/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.spec.ts +++ b/src/components/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.spec.ts @@ -33,12 +33,12 @@ describe('sbb-autocomplete-grid-option', () => { it('ShadowDom', async () => { await expect(root).shadowDom.to.be.equalSnapshot(); }); - - testA11yTreeSnapshot( - html`Option 1`, - ); }); + testA11yTreeSnapshot( + html`Option 1`, + ); + describe('disabled', () => { let root: SbbAutocompleteGridOptionElement; beforeEach(async () => { diff --git a/src/components/autocomplete-grid/autocomplete-grid/autocomplete-grid.spec.ts b/src/components/autocomplete-grid/autocomplete-grid/autocomplete-grid.spec.ts index 5ae11d42868..b9f54ac4888 100644 --- a/src/components/autocomplete-grid/autocomplete-grid/autocomplete-grid.spec.ts +++ b/src/components/autocomplete-grid/autocomplete-grid/autocomplete-grid.spec.ts @@ -1,5 +1,4 @@ import { expect } from '@open-wc/testing'; -import type { TemplateResult } from 'lit'; import { html } from 'lit/static-html.js'; import { isSafari } from '../../core/dom'; @@ -15,25 +14,24 @@ import '../autocomplete-grid-button'; describe('sbb-autocomplete-grid', () => { let root: SbbAutocompleteGridElement; - const grid: TemplateResult = html` - - - Option 1 - - - - - - Option 2 - - - - - - `; beforeEach(async () => { - root = await fixture(grid); + root = await fixture(html` + + + Option 1 + + + + + + Option 2 + + + + + + `); }); describeIf(!isSafari(), 'Chrome-Firefox', async () => { @@ -45,7 +43,7 @@ describe('sbb-autocomplete-grid', () => { await expect(root).shadowDom.to.be.equalSnapshot(); }); - testA11yTreeSnapshot(grid); + testA11yTreeSnapshot(); }); describeIf(isSafari(), 'Safari', async () => { @@ -57,6 +55,6 @@ describe('sbb-autocomplete-grid', () => { await expect(root).shadowDom.to.be.equalSnapshot(); }); - testA11yTreeSnapshot(grid); + testA11yTreeSnapshot(); }); });