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

Commit

Permalink
Update child-accessing test (currently failing)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbert committed Nov 15, 2016
1 parent 3f7c02e commit af7c7c0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/multiple-element-interactions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@ describe("When multiple DOM elements are present", () => {
});
});

// Pending until we decide on a good solution
xit("can read attributes from custom child element's prototypes", () => {
it("can read attributes from custom child element's prototypes", () => {
class DataSource extends customElements.HTMLElement {
get data() {
return [1, 2, 3];
}
}
customElements.define("data-source", DataSource);

class DataDisplayer extends customElements.HTMLElement {
connectedCallback() {
return new Promise((resolve) => {
// Has to be async, as child node prototypes aren't set: http://stackoverflow.com/questions/36187227/
// This is a web customElements limitation generally. TODO: Find a nicer pattern for handle this.
// This is a web components limitation generally. TODO: Find a nicer pattern for handle this.
setTimeout(() => {
var data = this.childNodes[0].data;
this.textContent = "Data: " + JSON.stringify(data);
Expand All @@ -62,9 +68,8 @@ describe("When multiple DOM elements are present", () => {
});
}
}
DataSource.data = [10, 20, 30];

customElements.define("data-displayer", DataSource);
customElements.define("data-displayer", DataDisplayer);

return customElements.renderFragment(
"<data-displayer><data-source></data-source></data-displayer>"
Expand Down

0 comments on commit af7c7c0

Please sign in to comment.