Skip to content

Commit 564d428

Browse files
committed
Chore: Linting fixes
1 parent fd3779c commit 564d428

File tree

7 files changed

+176
-228
lines changed

7 files changed

+176
-228
lines changed

packages/components/src/components/hds/stepper/nav/panel.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ import { guidFor } from '@ember/object/internals';
88
import { action } from '@ember/object';
99
import { modifier } from 'ember-modifier';
1010

11-
import type {
12-
HdsStepperNavStepIds,
13-
HdsStepperNavPanelIds,
14-
} from '../types.ts';
11+
import type { HdsStepperNavStepIds, HdsStepperNavPanelIds } from '../types.ts';
1512

1613
export interface HdsStepperNavPanelSignature {
1714
Args: {

packages/components/src/components/hds/stepper/nav/step.hbs

+2-12
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@
2828
/>
2929
</div>
3030
<div class="hds-stepper-nav__step__text">
31-
<Hds::Text::Body
32-
class="hds-stepper-nav__step__title"
33-
@tag={{this.titleTag}}
34-
@size="200"
35-
@weight="semibold"
36-
>
31+
<Hds::Text::Body class="hds-stepper-nav__step__title" @tag={{this.titleTag}} @size="200" @weight="semibold">
3732
<span class="sr-only">{{this.statusSrOnlyText}}</span>
3833
{{yield to="title"}}
3934
</Hds::Text::Body>
@@ -64,12 +59,7 @@
6459
/>
6560
</div>
6661
<div class="hds-stepper-nav__step__text">
67-
<Hds::Text::Body
68-
class="hds-stepper-nav__step__title"
69-
@tag={{this.titleTag}}
70-
@size="200"
71-
@weight="semibold"
72-
>
62+
<Hds::Text::Body class="hds-stepper-nav__step__title" @tag={{this.titleTag}} @size="200" @weight="semibold">
7363
<span class="sr-only">{{this.statusSrOnlyText}}</span>
7464
{{yield to="title"}}
7565
</Hds::Text::Body>

packages/components/src/components/hds/stepper/nav/step.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ import type {
2424

2525
export const MAPPING_STATUS_TO_INDICATOR_STATUS =
2626
HdsStepperNavStatusToIndicatorStatus;
27-
export const MAPPING_STATUS_TO_SR_ONLY_TEXT =
28-
HdsStepperNavStatusToSrOnlyText;
27+
export const MAPPING_STATUS_TO_SR_ONLY_TEXT = HdsStepperNavStatusToSrOnlyText;
2928

3029
export interface HdsStepperNavStepSignature {
3130
Args: {

packages/components/src/components/hds/stepper/types.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,15 @@ export enum HdsStepperNavStatusesValues {
6060
Complete = 'complete',
6161
}
6262

63-
export type HdsStepperNavStatuses =
64-
`${HdsStepperNavStatusesValues}`;
63+
export type HdsStepperNavStatuses = `${HdsStepperNavStatusesValues}`;
6564

6665
export const HdsStepperNavStatusToIndicatorStatus: Record<
6766
HdsStepperNavStatusesValues,
6867
HdsStepperStatusesValues
6968
> = {
70-
[HdsStepperNavStatusesValues.Incomplete]:
71-
HdsStepperStatusesValues.Incomplete,
72-
[HdsStepperNavStatusesValues.Active]:
73-
HdsStepperStatusesValues.Progress,
74-
[HdsStepperNavStatusesValues.Complete]:
75-
HdsStepperStatusesValues.Complete,
69+
[HdsStepperNavStatusesValues.Incomplete]: HdsStepperStatusesValues.Incomplete,
70+
[HdsStepperNavStatusesValues.Active]: HdsStepperStatusesValues.Progress,
71+
[HdsStepperNavStatusesValues.Complete]: HdsStepperStatusesValues.Complete,
7672
};
7773

7874
export const HdsStepperNavStatusToSrOnlyText: Record<

showcase/tests/integration/components/hds/stepper/nav-panel-test.js

+25-32
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,41 @@ import { hbs } from 'ember-cli-htmlbars';
1313
// it's practically impossible to test in isolation, so in our tests
1414
// in this file it will be wrapped inside its parent comoponent.
1515

16-
module(
17-
'Integration | Component | hds/stepper/nav/panel',
18-
function (hooks) {
19-
setupRenderingTest(hooks);
20-
21-
hooks.beforeEach(function () {
22-
this.set('createNavPanel', async (args = {}) => {
23-
this.currentStep = args.currentStep ?? undefined;
24-
return await render(hbs`
16+
module('Integration | Component | hds/stepper/nav/panel', function (hooks) {
17+
setupRenderingTest(hooks);
18+
19+
hooks.beforeEach(function () {
20+
this.set('createNavPanel', async (args = {}) => {
21+
this.currentStep = args.currentStep ?? undefined;
22+
return await render(hbs`
2523
<Hds::Stepper::Nav @currentStep={{this.currentStep}} as |S|>
2624
<S.Step></S.Step>
2725
<S.Panel>
2826
<div id="test-panel-content">Test</div>
2927
</S.Panel>
3028
</Hds::Stepper::Nav>
3129
`);
32-
});
3330
});
31+
});
3432

35-
// CLASSES
33+
// CLASSES
3634

37-
test('it should render the component with a CSS class that matches the component name', async function (assert) {
38-
await render(
39-
hbs`<Hds::Stepper::Nav::Panel data-test="panel-1" />`
40-
);
41-
assert
42-
.dom('[data-test="panel-1"]')
43-
.hasClass('hds-stepper-nav__panel');
44-
});
35+
test('it should render the component with a CSS class that matches the component name', async function (assert) {
36+
await render(hbs`<Hds::Stepper::Nav::Panel data-test="panel-1" />`);
37+
assert.dom('[data-test="panel-1"]').hasClass('hds-stepper-nav__panel');
38+
});
4539

46-
// VISIBILITY
40+
// VISIBILITY
4741

48-
test('it sets the panel content to not visible when the @currentStep argument does not match the panel index in the @panelIds argument', async function (assert) {
49-
await this.createNavPanel({ currentStep: 1 });
50-
assert.dom('.hds-stepper-nav__panel').hasAttribute('hidden');
51-
assert.dom('#test-panel-content').doesNotExist();
52-
});
42+
test('it sets the panel content to not visible when the @currentStep argument does not match the panel index in the @panelIds argument', async function (assert) {
43+
await this.createNavPanel({ currentStep: 1 });
44+
assert.dom('.hds-stepper-nav__panel').hasAttribute('hidden');
45+
assert.dom('#test-panel-content').doesNotExist();
46+
});
5347

54-
test('it sets the panel content to visible when the @currentStep argument matches the panel index in the @panelIds argument', async function (assert) {
55-
await this.createNavPanel({ currentStep: 0 });
56-
assert.dom('.hds-stepper-nav__panel').hasNoAttribute('hidden');
57-
assert.dom('#test-panel-content').exists();
58-
});
59-
}
60-
);
48+
test('it sets the panel content to visible when the @currentStep argument matches the panel index in the @panelIds argument', async function (assert) {
49+
await this.createNavPanel({ currentStep: 0 });
50+
assert.dom('.hds-stepper-nav__panel').hasNoAttribute('hidden');
51+
assert.dom('#test-panel-content').exists();
52+
});
53+
});

0 commit comments

Comments
 (0)