Skip to content

Commit

Permalink
Update server-side test for nested app
Browse files Browse the repository at this point in the history
  • Loading branch information
pablofierro committed Jun 3, 2019
1 parent 2095420 commit f3282e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion test/fixtures/nested-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class NestedApp extends Component {

template: state => h(`div`, {class: {'nested-foo': true}}, [
h(`h1`, `Nested app: ${state.title}`),
h(`h2`, `Nested child: ${state.childAnimal || `Not defined`}`),
this.child(`nested-child`, {attrs: {'child-animal': `fox`, 'state-animal': `llama`}}),
]),
};
Expand Down
3 changes: 2 additions & 1 deletion test/server/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe(`Server-side component renderer`, function() {
const nestedChild = el.childNodes[0].childNodes[1];
expect(nestedChild.childNodes).to.have.lengthOf(1);
expect(nestedChild.childNodes[0].className).to.equal(`nested-foo-child`);
expect(nestedChild.childNodes[0].childNodes).to.have.lengthOf(2);
expect(nestedChild.childNodes[0].childNodes).to.have.lengthOf(3);

// check content/HTML output
const html = el.innerHTML;
Expand All @@ -78,6 +78,7 @@ describe(`Server-side component renderer`, function() {
expect(html.toLowerCase()).to.contain(`<div class="nested-foo-child">`);
expect(html).to.contain(`parent title: test`);
expect(html).to.contain(`animal: llama`);
expect(html).to.contain(`child animal: fox`);
});

it(`updates nested components`, async function() {
Expand Down

0 comments on commit f3282e8

Please sign in to comment.