Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
kyubisation committed Mar 21, 2024
1 parent a2f6a06 commit 2991f01
Show file tree
Hide file tree
Showing 232 changed files with 1,082 additions and 578 deletions.
3 changes: 2 additions & 1 deletion src/components/accordion/accordion.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { assert, expect } from '@open-wc/testing';
import { nothing } from 'lit';
import { html } from 'lit/static-html.js';

import { waitForCondition, waitForLitRender, EventSpy, fixture, isSsr } from '../core/testing';
import { waitForCondition, waitForLitRender, EventSpy, isSsr } from '../core/testing';
import { fixture } from '../core/testing/private';
import { SbbExpansionPanelElement, type SbbExpansionPanelHeaderElement } from '../expansion-panel';

import { SbbAccordionElement } from './accordion';
Expand Down
6 changes: 3 additions & 3 deletions src/components/accordion/accordion.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import { waitForLitRender } from '../core/testing';
import { testA11yTreeSnapshot } from '../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../core/testing/private';

import type { SbbAccordionElement } from './accordion';
import './accordion';
import '../expansion-panel';

describe('sbb-accordion', () => {
describe(`sbb-accordion`, () => {
let element: SbbAccordionElement;

beforeEach(async () => {
Expand Down
9 changes: 4 additions & 5 deletions src/components/action-group/action-group.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import { assert, expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import type { SbbSecondaryButtonElement } from '../button';
import { fixture, waitForLitRender } from '../core/testing';
import { waitForLitRender } from '../core/testing';
import { fixture } from '../core/testing/private';
import type { SbbBlockLinkElement } from '../link';
import '../button/secondary-button';
import '../link/block-link';

import { SbbActionGroupElement } from './action-group';

import '../button';
import '../link';
import '../button/secondary-button';
import '../link/block-link';

describe(`sbb-action-group with ${fixture.name}`, () => {
let element: SbbActionGroupElement;
Expand Down
6 changes: 3 additions & 3 deletions src/components/action-group/action-group.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import type { SbbSecondaryButtonElement } from '../button';
import { waitForLitRender } from '../core/testing';
import { testA11yTreeSnapshot } from '../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../core/testing/private';

import type { SbbActionGroupElement } from './action-group';
import './action-group';
import '../button/secondary-button';
import '../link/block-link';

describe('sbb-action-group', () => {
describe(`sbb-action-group`, () => {
describe('renders', () => {
let element: SbbActionGroupElement;

Expand Down
3 changes: 2 additions & 1 deletion src/components/alert/alert-group/alert-group.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import type { SbbTransparentButtonElement } from '../../button';
import { waitForCondition, EventSpy, waitForLitRender, fixture } from '../../core/testing';
import { waitForCondition, EventSpy, waitForLitRender } from '../../core/testing';
import { fixture } from '../../core/testing/private';
import type { SbbAlertElement } from '../alert';

import { SbbAlertGroupElement } from './alert-group';
Expand Down
6 changes: 3 additions & 3 deletions src/components/alert/alert-group/alert-group.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import { waitForLitRender } from '../../core/testing';
import { testA11yTreeSnapshot } from '../../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../../core/testing/private';

import type { SbbAlertGroupElement } from './alert-group';
import './alert-group';
import '../alert';

describe('sbb-alert-group', () => {
describe(`sbb-alert-group`, () => {
describe('should render', () => {
let root: SbbAlertGroupElement;

Expand Down
3 changes: 2 additions & 1 deletion src/components/alert/alert/alert.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { assert, expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import { waitForCondition, EventSpy, fixture } from '../../core/testing';
import { waitForCondition, EventSpy } from '../../core/testing';
import { fixture } from '../../core/testing/private';

import { SbbAlertElement } from './alert';

Expand Down
6 changes: 3 additions & 3 deletions src/components/alert/alert/alert.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import { waitForLitRender } from '../../core/testing';
import { testA11yTreeSnapshot } from '../../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../../core/testing/private';

import type { SbbAlertElement } from './alert';

import './alert';

describe('sbb-alert', () => {
describe(`sbb-alert`, () => {
let element: SbbAlertElement;

it('should render default properties', async () => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/autocomplete/autocomplete.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { assert, expect } from '@open-wc/testing';
import { sendKeys, sendMouse } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';

import { waitForCondition, waitForLitRender, EventSpy, fixture } from '../core/testing';
import { waitForCondition, waitForLitRender, EventSpy } from '../core/testing';
import { fixture } from '../core/testing/private';
import { SbbFormFieldElement } from '../form-field';
import { SbbOptionElement } from '../option';

Expand Down
6 changes: 3 additions & 3 deletions src/components/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import { isSafari } from '../core/dom';
import { describeIf, waitForLitRender } from '../core/testing';
import { testA11yTreeSnapshot } from '../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../core/testing/private';
import type { SbbFormFieldElement } from '../form-field';

import type { SbbAutocompleteElement } from './autocomplete';
import '../form-field';
import '../option';
import './autocomplete';

describe('sbb-autocomplete', () => {
describe(`sbb-autocomplete`, () => {
describe('renders standalone', async () => {
let elem: SbbAutocompleteElement;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { assert, expect } from '@open-wc/testing';
import { sendKeys, setViewport } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';

import { waitForCondition, EventSpy, waitForLitRender, fixture } from '../../core/testing';
import { waitForCondition, EventSpy, waitForLitRender } from '../../core/testing';
import { fixture } from '../../core/testing/private';
import type { SbbBreadcrumbElement } from '../breadcrumb';
import '../breadcrumb';

import { SbbBreadcrumbGroupElement } from './breadcrumb-group';

import '../breadcrumb';

describe(`sbb-breadcrumb-group with ${fixture.name}`, () => {
describe('without ellipsis', () => {
let element: SbbBreadcrumbGroupElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import { waitForLitRender } from '../../core/testing';
import { testA11yTreeSnapshot } from '../../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../../core/testing/private';

import type { SbbBreadcrumbGroupElement } from './breadcrumb-group';

import '../breadcrumb';
import './breadcrumb-group';

describe('sbb-breadcrumb-group', () => {
describe(`sbb-breadcrumb-group`, () => {
let root: SbbBreadcrumbGroupElement;

beforeEach(async () => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/breadcrumb/breadcrumb/breadcrumb.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { assert, expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import { waitForCondition, EventSpy, waitForLitRender, fixture } from '../../core/testing';
import { waitForCondition, EventSpy, waitForLitRender } from '../../core/testing';
import { fixture } from '../../core/testing/private';

import { SbbBreadcrumbElement } from './breadcrumb';

Expand Down
6 changes: 3 additions & 3 deletions src/components/breadcrumb/breadcrumb/breadcrumb.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';
import { html } from 'lit/static-html.js';

import { waitForLitRender } from '../../core/testing';
import { testA11yTreeSnapshot } from '../../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../../core/testing/private';

import './breadcrumb';

describe('sbb-breadcrumb', () => {
describe(`sbb-breadcrumb`, () => {
it('renders with text', async () => {
const root = await fixture(html`
<sbb-breadcrumb href="https://example.com/test" target="_blank" download rel="subsection"
Expand Down
3 changes: 2 additions & 1 deletion src/components/button/button-link/button-link.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { assert, expect } from '@open-wc/testing';
import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';

import { EventSpy, waitForCondition, waitForLitRender, fixture } from '../../core/testing';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
import { fixture } from '../../core/testing/private';

import { SbbButtonLinkElement } from './button-link';

Expand Down
6 changes: 3 additions & 3 deletions src/components/button/button-link/button-link.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';

import { waitForLitRender } from '../../core/testing';
import { testA11yTreeSnapshot } from '../../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../../core/testing/private';
import { buttonLinkIconTestTemplate, buttonLinkTestTemplate } from '../common/button-test-utils';

import type { SbbButtonLinkElement } from './button-link';
import './button-link';

describe('sbb-button-link', () => {
describe(`sbb-button-link`, () => {
describe('renders a sbb-button-link without icon', async () => {
let root: SbbButtonLinkElement;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,32 @@ snapshots["sbb-button-static renders a sbb-button-static with slotted icon A11y
`;
/* end snapshot sbb-button-static renders a sbb-button-static with slotted icon A11y tree Safari */

snapshots["sbb-button-static renders a sbb-button-static without icon Dom"] =
`<sbb-button-static
data-action=""
data-sbb-button=""
data-slot-names="unnamed"
dir="ltr"
disabled=""
negative=""
size="m"
>
Label Text
</sbb-button-static>
`;
/* end snapshot sbb-button-static renders a sbb-button-static without icon Dom */

snapshots["sbb-button-static renders a sbb-button-static without icon ShadowDom"] =
`<span class="sbb-action-base sbb-button-static">
<span class="sbb-button__icon">
<slot name="icon">
</slot>
</span>
<span class="sbb-button__label">
<slot>
</slot>
</span>
</span>
`;
/* end snapshot sbb-button-static renders a sbb-button-static without icon ShadowDom */

3 changes: 2 additions & 1 deletion src/components/button/button-static/button-static.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { assert, expect } from '@open-wc/testing';
import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';

import { EventSpy, waitForCondition, waitForLitRender, fixture } from '../../core/testing';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
import { fixture } from '../../core/testing/private';

import { SbbButtonStaticElement } from './button-static';

Expand Down
16 changes: 9 additions & 7 deletions src/components/button/button-static/button-static.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect, fixture } from '@open-wc/testing';
import { expect } from '@open-wc/testing';

import { waitForLitRender } from '../../core/testing';
import { testA11yTreeSnapshot } from '../../core/testing/a11y-tree-snapshot';
import { fixture, testA11yTreeSnapshot } from '../../core/testing/private';
import {
buttonIconTestTemplate,
buttonSlottedIconTestTemplate,
Expand All @@ -10,11 +9,16 @@ import {
} from '../common/button-test-utils';

import type { SbbButtonStaticElement } from './button-static';

import './button-static';

describe('sbb-button-static', () => {
describe(`sbb-button-static`, () => {
describe('renders a sbb-button-static without icon', async () => {
const root = await fixture(buttonTestTemplate('sbb-button-static', true));
let root: SbbButtonStaticElement;

beforeEach(async () => {
root = await fixture(buttonTestTemplate('sbb-button-static', true));
});

it('Dom', async () => {
await expect(root).dom.to.be.equalSnapshot();
Expand All @@ -30,7 +34,6 @@ describe('sbb-button-static', () => {

beforeEach(async () => {
root = await fixture(buttonSlottedIconTestTemplate('sbb-button-static'));
await waitForLitRender(root);
});

it('Dom', async () => {
Expand All @@ -46,7 +49,6 @@ describe('sbb-button-static', () => {

it('should detect icon in sbb-button-static', async () => {
const root = await fixture(buttonIconTestTemplate('sbb-button-static'));
await waitForLitRender(root);
const dataSlots = root.getAttribute('data-slot-names');
expect(dataSlots).to.contain('icon');
expect(dataSlots).not.to.contain('unnamed');
Expand Down
36 changes: 36 additions & 0 deletions src/components/button/button/__snapshots__/button.spec.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,39 @@ snapshots["sbb-button renders a sbb-button with slotted icon A11y tree Safari"]
`;
/* end snapshot sbb-button renders a sbb-button with slotted icon A11y tree Safari */

snapshots["sbb-button renders a sbb-button without icon Dom"] =
`<sbb-button
aria-disabled="true"
data-action=""
data-button=""
data-sbb-button=""
data-slot-names="unnamed"
dir="ltr"
disabled=""
form="formid"
name="name"
negative=""
role="button"
size="m"
type="button"
value="value"
>
Label Text
</sbb-button>
`;
/* end snapshot sbb-button renders a sbb-button without icon Dom */

snapshots["sbb-button renders a sbb-button without icon ShadowDom"] =
`<span class="sbb-action-base sbb-button">
<span class="sbb-button__icon">
<slot name="icon">
</slot>
</span>
<span class="sbb-button__label">
<slot>
</slot>
</span>
</span>
`;
/* end snapshot sbb-button renders a sbb-button without icon ShadowDom */

3 changes: 2 additions & 1 deletion src/components/button/button/button.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { assert, expect } from '@open-wc/testing';
import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';

import { EventSpy, waitForCondition, waitForLitRender, fixture } from '../../core/testing';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
import { fixture } from '../../core/testing/private';

import { SbbButtonElement } from './button';

Expand Down
Loading

0 comments on commit 2991f01

Please sign in to comment.