From 7aaa5ad3ce03d27a89c20a9a70aa626188b976f9 Mon Sep 17 00:00:00 2001 From: Craig Beck Date: Mon, 8 Jul 2024 13:23:42 -0700 Subject: [PATCH] Fix component tests to use harness.renderDom --- test/dom/components.browser.mocha.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/dom/components.browser.mocha.js b/test/dom/components.browser.mocha.js index 246180e8..cdf3c7b7 100644 --- a/test/dom/components.browser.mocha.js +++ b/test/dom/components.browser.mocha.js @@ -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', ''); + const harness = runner.createHarness( ''); + const { app } = harness; app.views.register('box', '
'); var called = false; var update = function() { @@ -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(); @@ -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', ''); + const harness = runner.createHarness( ''); + const { app } = harness; app.views.register('box', '
'); var called = false; var box; @@ -143,6 +142,7 @@ describe('components', function() { this.update = getFn.call(this, update); }; app.component('box', Box); + const page = harness.renderDom(); box = page.box; box.update(); box.update(); @@ -150,9 +150,8 @@ describe('components', function() { }); it('calls with the most recent arguments', function(done) { - const { app } = runner.createHarness(); - var page = app.createPage(); - app.views.register('Body', ''); + const harness = runner.createHarness( ''); + const { app } = harness; app.views.register('box', '
'); var called = false; var box; @@ -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);