Skip to content

Commit e2e69e7

Browse files
committed
fix(tools): generate better element tests
1 parent e1fd79c commit e2e69e7

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

tools/create-element/templates/element/test/element.spec.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ import { expect, html } from '@open-wc/testing';
22
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
33
import { <%= className %> } from '<%= importSpecifier %>';
44

5-
const element = html`
6-
<<%= tagName %>></<%= tagName %>>
7-
`;
8-
95
describe('<<%= tagName %>>', function() {
10-
it('should upgrade', async function() {
11-
const el = await createFixture <<%= className %>> (element);
12-
const klass = customElements.get('<%= tagName %>');
13-
expect(el)
14-
.to.be.an.instanceOf(klass)
15-
.and
16-
.to.be.an.instanceOf(<%= className %>);
17-
});
6+
describe('simply instantiating', function() {
7+
let element: <%= className %>;
8+
it('should upgrade', async function() {
9+
element = await createFixture<<%= className %>>(html`<<%= tagName %>></<%= tagName %>>`);
10+
const klass = customElements.get('<%= tagName %>');
11+
expect(element)
12+
.to.be.an.instanceOf(klass)
13+
.and
14+
.to.be.an.instanceOf(<%= className %>);
15+
});
16+
})
1817
});

0 commit comments

Comments
 (0)