Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit af7c7c0

Browse files
committed
Update child-accessing test (currently failing)
1 parent 3f7c02e commit af7c7c0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/multiple-element-interactions-test.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,19 @@ describe("When multiple DOM elements are present", () => {
4747
});
4848
});
4949

50-
// Pending until we decide on a good solution
51-
xit("can read attributes from custom child element's prototypes", () => {
50+
it("can read attributes from custom child element's prototypes", () => {
5251
class DataSource extends customElements.HTMLElement {
52+
get data() {
53+
return [1, 2, 3];
54+
}
55+
}
56+
customElements.define("data-source", DataSource);
57+
58+
class DataDisplayer extends customElements.HTMLElement {
5359
connectedCallback() {
5460
return new Promise((resolve) => {
5561
// Has to be async, as child node prototypes aren't set: http://stackoverflow.com/questions/36187227/
56-
// This is a web customElements limitation generally. TODO: Find a nicer pattern for handle this.
62+
// This is a web components limitation generally. TODO: Find a nicer pattern for handle this.
5763
setTimeout(() => {
5864
var data = this.childNodes[0].data;
5965
this.textContent = "Data: " + JSON.stringify(data);
@@ -62,9 +68,8 @@ describe("When multiple DOM elements are present", () => {
6268
});
6369
}
6470
}
65-
DataSource.data = [10, 20, 30];
6671

67-
customElements.define("data-displayer", DataSource);
72+
customElements.define("data-displayer", DataDisplayer);
6873

6974
return customElements.renderFragment(
7075
"<data-displayer><data-source></data-source></data-displayer>"

0 commit comments

Comments
 (0)