Skip to content

Commit 02728c4

Browse files
author
shleewhite
committed
chore: lint helper, modifier integration tests
1 parent b71ea29 commit 02728c4

File tree

4 files changed

+228
-65
lines changed

4 files changed

+228
-65
lines changed

showcase/tests/integration/helpers/hds-t-test.gjs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { module, test } from 'qunit';
77
import { setupRenderingTest } from 'showcase/tests/helpers';
88
import { render, setupOnerror } from '@ember/test-helpers';
9-
import hdsT from "@hashicorp/design-system-components/helpers/hds-t";
9+
import hdsT from '@hashicorp/design-system-components/helpers/hds-t';
1010

1111
const defaultString = 'Default text';
1212

@@ -54,7 +54,9 @@ module('Integration | Helper | hds-t', function (hooks) {
5454
this.set('translationKey', value);
5555

5656
await render(
57-
<template>{{hdsT this.translationKey default=this.defaultString}}</template>,
57+
<template>
58+
{{hdsT this.translationKey default=this.defaultString}}
59+
</template>,
5860
);
5961

6062
assert.throws(function () {
@@ -76,7 +78,9 @@ module('Integration | Helper | hds-t', function (hooks) {
7678

7779
this.set('key', 'greeting');
7880

79-
await render(<template>{{hdsT this.key default=this.defaultString}}</template>);
81+
await render(
82+
<template>{{hdsT this.key default=this.defaultString}}</template>,
83+
);
8084

8185
assert.dom().hasText('Hello from Real Intl!');
8286
});
@@ -93,7 +97,14 @@ module('Integration | Helper | hds-t', function (hooks) {
9397
});
9498

9599
await render(
96-
<template>{{hdsT this.key name=this.nameParam age=this.ageParam default=this.defaultString}}</template>,
100+
<template>
101+
{{hdsT
102+
this.key
103+
name=this.nameParam
104+
age=this.ageParam
105+
default=this.defaultString
106+
}}
107+
</template>,
97108
);
98109

99110
assert.dom().hasText('Goodbye Tester, aged 30!');
@@ -109,7 +120,9 @@ module('Integration | Helper | hds-t', function (hooks) {
109120
`intl.exists('${testKey}') is false`,
110121
);
111122

112-
await render(<template>{{hdsT this.key default=this.defaultString}}</template>);
123+
await render(
124+
<template>{{hdsT this.key default=this.defaultString}}</template>,
125+
);
113126

114127
assert
115128
.dom()

showcase/tests/integration/modifiers/hds-anchored-position-test.gjs

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { module, test } from 'qunit';
77
import { setupRenderingTest } from 'showcase/tests/helpers';
88
import { render } from '@ember/test-helpers';
99
import { wait } from 'showcase/tests/helpers';
10-
import hdsAnchoredPosition, { getFloatingUIOptions } from '@hashicorp/design-system-components/modifiers/hds-anchored-position';
10+
import hdsAnchoredPosition, {
11+
getFloatingUIOptions,
12+
} from '@hashicorp/design-system-components/modifiers/hds-anchored-position';
1113
import anchoredElementModifier from '@hashicorp/design-system-components/modifiers/hds-anchored-position';
1214

1315
//
@@ -213,12 +215,14 @@ module('Integration | Modifier | hds-anchored-position', function (hooks) {
213215
});
214216

215217
test('render "anchor/floating/arrow" elements with default `options`', async function (assert) {
216-
await render(<template>
217-
<div id="wrapper">
218-
<div id="anchor">anchor</div>
219-
<div id="floating"><div id="arrow"></div>floating</div>
220-
</div>
221-
</template>);
218+
await render(
219+
<template>
220+
<div id="wrapper">
221+
<div id="anchor">anchor</div>
222+
<div id="floating"><div id="arrow"></div>floating</div>
223+
</div>
224+
</template>,
225+
);
222226
this.anchorElement = document.getElementById('anchor');
223227
this.floatingElement = document.getElementById('floating');
224228
this.arrowElement = document.getElementById('arrow');
@@ -245,12 +249,14 @@ module('Integration | Modifier | hds-anchored-position', function (hooks) {
245249
});
246250

247251
test('render "anchor/floating/arrow" elements with custom options', async function (assert) {
248-
await render(<template>
249-
<div id="wrapper">
250-
<div id="anchor">anchor</div>
251-
<div id="floating"><div id="arrow"></div>floating</div>
252-
</div>
253-
</template>);
252+
await render(
253+
<template>
254+
<div id="wrapper">
255+
<div id="anchor">anchor</div>
256+
<div id="floating"><div id="arrow"></div>floating</div>
257+
</div>
258+
</template>,
259+
);
254260
this.anchorElement = document.getElementById('anchor');
255261
this.floatingElement = document.getElementById('floating');
256262
this.arrowElement = document.getElementById('arrow');
@@ -283,12 +289,23 @@ module('Integration | Modifier | hds-anchored-position', function (hooks) {
283289
});
284290

285291
test('the modifier works also when applied directly in the template code', async function (assert) {
286-
await render(<template>
287-
<div id="wrapper">
288-
<div id="anchor">anchor</div>
289-
<div id="floating" {{hdsAnchoredPosition "#anchor" placement="bottom-start" strategy="fixed" offsetOptions=20 arrowSelector="#arrow"}}><div id="arrow"></div>floating</div>
290-
</div>
291-
</template>);
292+
await render(
293+
<template>
294+
<div id="wrapper">
295+
<div id="anchor">anchor</div>
296+
<div
297+
id="floating"
298+
{{hdsAnchoredPosition
299+
"#anchor"
300+
placement="bottom-start"
301+
strategy="fixed"
302+
offsetOptions=20
303+
arrowSelector="#arrow"
304+
}}
305+
><div id="arrow"></div>floating</div>
306+
</div>
307+
</template>,
308+
);
292309
this.anchorElement = document.getElementById('anchor');
293310
this.floatingElement = document.getElementById('floating');
294311
this.arrowElement = document.getElementById('arrow');

0 commit comments

Comments
 (0)