Skip to content

Commit 76861cc

Browse files
committed
Add Glint support to the AuHr component
1 parent e007248 commit 76861cc

File tree

5 files changed

+30
-18
lines changed

5 files changed

+30
-18
lines changed

addon/components/au-hr.gjs addon/components/au-hr.gts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import Component from '@glimmer/component';
22

3-
export default class AuHr extends Component {
3+
export interface AuHrSignature {
4+
Args: {
5+
size?: 'large' | 'huge';
6+
};
7+
Element: HTMLHRElement;
8+
}
9+
10+
export default class AuHr extends Component<AuHrSignature> {
411
get size() {
512
if (this.args.size == 'large') return 'au-c-hr--large';
613
if (this.args.size == 'huge') return 'au-c-hr--huge';

addon/template-registry.ts

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type AuCheckboxGroup from '@appuniversum/ember-appuniversum/components/au
1313
import type AuContentHeader from '@appuniversum/ember-appuniversum/components/au-content-header';
1414
import type AuContent from '@appuniversum/ember-appuniversum/components/au-content';
1515
import type AuDateInput from '@appuniversum/ember-appuniversum/components/au-date-input';
16+
import type AuHr from '@appuniversum/ember-appuniversum/components/au-hr';
1617
import type AuIcon from '@appuniversum/ember-appuniversum/components/au-icon';
1718
import type AuInput from '@appuniversum/ember-appuniversum/components/au-input';
1819
import type AuLinkExternal from '@appuniversum/ember-appuniversum/components/au-link-external';
@@ -40,6 +41,7 @@ export default interface AppuniversumRegistry {
4041
AuContentHeader: typeof AuContentHeader;
4142
AuContent: typeof AuContent;
4243
AuDateInput: typeof AuDateInput;
44+
AuHr: typeof AuHr;
4345
AuIcon: typeof AuIcon;
4446
AuInput: typeof AuInput;
4547
AuLinkExternal: typeof AuLinkExternal;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { module, test } from 'qunit';
2+
import { setupRenderingTest } from 'ember-qunit';
3+
import { render } from '@ember/test-helpers';
4+
import AuHr from '@appuniversum/ember-appuniversum/components/au-hr';
5+
6+
module('Integration | Component | au-hr', function (hooks) {
7+
setupRenderingTest(hooks);
8+
9+
test('it passes through extra attributes', async function (assert) {
10+
await render(<template><AuHr data-test-hr/></template>);
11+
12+
assert.dom('[data-test-hr]').exists();
13+
});
14+
});

tests/integration/components/au-hr-test.js

-17
This file was deleted.

tests/integration/components/loose-mode-test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ module('Integration | Component | Loose mode', function (hooks) {
107107
assert.dom('[data-test-date-input]').exists();
108108
});
109109

110+
test('`<AuHr>` resolves in loose mode', async function (assert) {
111+
await render(hbs`<AuHr data-test-hr />`);
112+
113+
assert.dom('[data-test-hr]').exists();
114+
});
115+
110116
test('`<AuIcon>` resolves in loose mode', async function (assert) {
111117
await render(hbs`<AuIcon data-test-icon @icon="test" />`);
112118

0 commit comments

Comments
 (0)