Skip to content

Commit

Permalink
Fix component tests to use harness.renderDom
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbeck committed Jul 8, 2024
1 parent 7cd3c42 commit 7aaa5ad
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/dom/components.browser.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ describe('components', function() {
options = options || {};

it('calls a function once with `this` being the component', function(done) {
const { app } = runner.createHarness();
var page = app.createPage();
app.views.register('Body', '<view is="box" as="box"></view>');
const harness = runner.createHarness( '<view is="box" as="box"></view>');
const { app } = harness;
app.views.register('box', '<div></div>');
var called = false;
var update = function() {
Expand All @@ -110,6 +109,7 @@ describe('components', function() {
this.update = getFn.call(this, update);
};
app.component('box', Box);
const page = harness.renderDom();
var box = page.box;
box.update();
box.update();
Expand All @@ -118,9 +118,8 @@ describe('components', function() {
});

it('resets and calls again', function(done) {
const { app } = runner.createHarness();
var page = app.createPage();
app.views.register('Body', '<view is="box" as="box"></view>');
const harness = runner.createHarness( '<view is="box" as="box"></view>');
const { app } = harness;
app.views.register('box', '<div></div>');
var called = false;
var box;
Expand All @@ -143,16 +142,16 @@ describe('components', function() {
this.update = getFn.call(this, update);
};
app.component('box', Box);
const page = harness.renderDom();
box = page.box;
box.update();
box.update();
box.update();
});

it('calls with the most recent arguments', function(done) {
const { app } = runner.createHarness();
var page = app.createPage();
app.views.register('Body', '<view is="box" as="box"></view>');
const harness = runner.createHarness( '<view is="box" as="box"></view>');
const { app } = harness;
app.views.register('box', '<div></div>');
var called = false;
var box;
Expand Down Expand Up @@ -181,6 +180,7 @@ describe('components', function() {
this.update = getFn.call(this, update);
};
app.component('box', Box);
const page = harness.renderDom();
box = page.box;
box.update('a', 1);
box.update('b', 2);
Expand Down

0 comments on commit 7aaa5ad

Please sign in to comment.