Skip to content

Commit

Permalink
test(sbb-mini-button): stabilize ssr test
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMenga committed Jul 24, 2024
1 parent f8a5f51 commit e3847d2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
32 changes: 15 additions & 17 deletions src/elements/mini-button-group/mini-button-group.ssr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,22 @@ import '../button/mini-button.js';
import '../divider/divider.js';

describe(`sbb-mini-button-group ssr`, () => {
it('renders', () => {
let root: SbbMiniButtonGroupElement;
let root: SbbMiniButtonGroupElement;

beforeEach(async () => {
root = await ssrHydratedFixture(
html`<sbb-mini-button-group>
<sbb-mini-button icon-name="pen-small"></sbb-mini-button>
<sbb-divider orientation="vertical"></sbb-divider>
<sbb-mini-button icon-name="pen-small"></sbb-mini-button>
</sbb-mini-button-group>`,
{
modules: ['./mini-button-group.js', '../divider/divider.js', '../button/mini-button.js'],
},
);
});
beforeEach(async () => {
root = await ssrHydratedFixture(
html`<sbb-mini-button-group>
<sbb-mini-button icon-name="pen-small"></sbb-mini-button>
<sbb-divider orientation="vertical"></sbb-divider>
<sbb-mini-button icon-name="pen-small"></sbb-mini-button>
</sbb-mini-button-group>`,
{
modules: ['./mini-button-group.js', '../divider/divider.js', '../button/mini-button.js'],
},
);
});

it('renders', () => {
assert.instanceOf(root, SbbMiniButtonGroupElement);
});
it('renders', () => {
assert.instanceOf(root, SbbMiniButtonGroupElement);
});
});
2 changes: 1 addition & 1 deletion src/elements/mini-button-group/mini-button-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class SbbMiniButtonGroupElement extends SbbNegativeMixin(
}

private _proxyNegative(): void {
this.querySelectorAll<SbbDividerElement | SbbMiniButtonElement>(
this.querySelectorAll?.<SbbDividerElement | SbbMiniButtonElement>(
'sbb-divider, sbb-mini-button',
).forEach((e) => (e.negative = this.negative));
}
Expand Down
16 changes: 7 additions & 9 deletions tools/generate-component/boilerplate/component.ssr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import { ssrHydratedFixture } from '../core/testing/private.js';
import { __nameUpperCase__ } from './__noPrefixName__.js';

describe(`__name__ ssr`, () => {
it('renders', () => {
let root: __nameUpperCase__;
let root: __nameUpperCase__;

beforeEach(async () => {
root = await ssrHydratedFixture(html`<__name__ my-prop="Label"></__name__>`, {
modules: ['./__noPrefixName__.js'],
});
beforeEach(async () => {
root = await ssrHydratedFixture(html`<__name__ my-prop="Label"></__name__>`, {
modules: ['./__noPrefixName__.js'],
});
});

it('renders', () => {
assert.instanceOf(root, __nameUpperCase__);
});
it('renders', () => {
assert.instanceOf(root, __nameUpperCase__);
});
});

0 comments on commit e3847d2

Please sign in to comment.