Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideMininni-Fincons committed Sep 9, 2024
1 parent c64b13f commit 3a6bd88
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/elements/header/header/header.visual.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { html, type TemplateResult } from 'lit';
import { html, nothing, type TemplateResult } from 'lit';

import { describeViewports, visualDiffDefault } from '../../core/testing/private.js';

import './header.js';
import '../header-link.js';
import '../header-button.js';
import '../../menu.js';
import '../../signet.js';

describe(`sbb-header`, () => {
const loremIpsumTemplate = `
Expand Down Expand Up @@ -37,6 +38,9 @@ describe(`sbb-header`, () => {
Christina Müller
</sbb-header-button>
<sbb-header-button icon-name="globe-small" class="last-element"> English </sbb-header-button>
${size === 's'
? html`<sbb-signet slot="logo" protective-room="none" padded></sbb-signet>`
: nothing}
</sbb-header>
<div class=${expanded ? 'sbb-page-spacing-expanded' : 'sbb-page-spacing'}>
${loremIpsumTemplate}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/signet/signet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class SbbSignetElement extends LitElement {
? html`
<svg focusable="false" viewBox="0 0 143 48" xmlns="http://www.w3.org/2000/svg">
<title .textContent=${this.accessibilityLabel}></title>
<path id="sbb-signet__panel" stroke-width="1" d="M1 47h141V1H1v46z"></path>
<path id="sbb-signet__panel" d="M1 47h141V1H1v46z"></path>
<path
id="sbb-signet__icon"
d="M87 40h9.3L83.8 27.7h15.5V40h7.4V27.7h15.6L109.7 40h9.3l16-16-15.9-16h-9.3l12.5 12.3h-15.6V8h-7.4v12.3H83.8L96.3 8H87L71 24l16 16z"
Expand Down
17 changes: 10 additions & 7 deletions src/elements/signet/signet.visual.spec.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import { html } from 'lit';

import { describeViewports, visualDiffDefault } from '../core/testing/private.js';
import { describeEach, describeViewports, visualDiffDefault } from '../core/testing/private.js';

import './signet.js';

describe(`sbb-signet`, () => {
const protectiveRooms = ['none', 'minimal', 'ideal'];
const cases = {
protectiveRooms: ['none', 'minimal', 'ideal'],
forcedColors: [false, true],
};

describeViewports({ viewports: ['zero'] }, () => {
for (const protectiveRoom of protectiveRooms) {
describeEach(cases, ({ protectiveRooms, forcedColors }) => {
it(
`protectiveRoom=${protectiveRoom}`,
``,
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html`<sbb-signet protective-room=${protectiveRoom}></sbb-signet>`,
{ padding: '0', maxWidth: '300px' },
html`<sbb-signet protective-room=${protectiveRooms}></sbb-signet>`,
{ padding: '0', maxWidth: '300px', forcedColors },
);
}),
);
}
});
});
});

0 comments on commit 3a6bd88

Please sign in to comment.