Skip to content

Commit 63ed4ee

Browse files
committed
test: add regression test for element not calling attachInternals
See calebdwilliams#127
1 parent 447e377 commit 63ed4ee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: test/FormElements.test.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, fixture, html } from '@open-wc/testing';
22
import '../dist/index.js';
3-
3+
import '@material/web/button/filled-button.js';
4+
import { MdFilledButton } from '@material/web/button/filled-button.js';
45
class TestInput extends HTMLElement {
56
static formAssociated = true;
67
internals = this.attachInternals();
@@ -22,18 +23,20 @@ async function createForm(): Promise<HTMLFormElement> {
2223
<test-input name="second" id="ti2"></test-input>
2324
<test-input name="third" id="ti3"></test-input>
2425
<button type="submit">Submit</button>
26+
<md-filled-button type="submit">Submit Material</md-filled-button>
2527
</form>`);
2628
}
2729

2830
it('must contains the custom elements associated to the current form, in the correct order', async () => {
2931
const form = await createForm();
30-
expect(form.elements).to.have.length(5);
32+
expect(form.elements).to.have.length(6);
3133

3234
expect(form.elements[0]).to.be.an.instanceof(HTMLInputElement);
3335
expect(form.elements[1]).to.be.an.instanceof(TestInput);
3436
expect(form.elements[2]).to.be.an.instanceof(TestInput);
3537
expect(form.elements[3]).to.be.an.instanceof(TestInput);
3638
expect(form.elements[4]).to.be.an.instanceof(HTMLButtonElement);
39+
expect(form.elements[5]).to.be.an.instanceof(MdFilledButton);
3740

3841
expect(form.elements[0].id).to.equal('foo');
3942
expect(form.elements[1].id).to.equal('ti1');

0 commit comments

Comments
 (0)