Skip to content

Commit

Permalink
fix(pix-ui): fix test crash on sinon.createSandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
rouxxi authored and er-lim committed Nov 19, 2024
1 parent d3a13dd commit efff82b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
13 changes: 4 additions & 9 deletions tests/integration/components/pix-checkbox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ module('Integration | Component | checkbox', function (hooks) {
module('@isDisabled', function (hooks) {
let sandbox;
hooks.beforeEach(function () {
sandbox = sinon.createSandbox();
sandbox.stub(EmberDebug, 'warn');
});

hooks.afterEach(function () {
sandbox.restore();
sandbox = sinon.stub(EmberDebug, 'warn');
});

test(`it should not be possible to interact when @isDisabled={{true}}`, async function (assert) {
Expand All @@ -76,7 +71,7 @@ module('Integration | Component | checkbox', function (hooks) {
const screen = await render(
hbs`<PixCheckbox checked @isDisabled={{this.isDisabled}}><:label>Recevoir la newsletter</:label></PixCheckbox>`,
);
sandbox.assert.calledWith(
sandbox.calledWith(
EmberDebug.warn,
'PixCheckbox: @isDisabled attribute should be a boolean.',
true,
Expand Down Expand Up @@ -149,7 +144,7 @@ module('Integration | Component | checkbox', function (hooks) {
const screen = await render(
hbs`<PixCheckbox checked @isDisabled={{this.isDisabled}}><:label>Recevoir la newsletter</:label></PixCheckbox>`,
);
sandbox.assert.calledWith(
sandbox.calledWith(
EmberDebug.warn,
'PixCheckbox: @isDisabled attribute should be a boolean.',
false,
Expand Down Expand Up @@ -183,7 +178,7 @@ module('Integration | Component | checkbox', function (hooks) {
const screen = await render(
hbs`<PixCheckbox checked @isDisabled={{this.isDisabled}}><:label>Recevoir la newsletter</:label></PixCheckbox>`,
);
sandbox.assert.calledWith(
sandbox.calledWith(
EmberDebug.warn,
'PixCheckbox: @isDisabled attribute should be a boolean.',
true,
Expand Down
14 changes: 5 additions & 9 deletions tests/integration/components/pix-radio-button-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ module('Integration | Component | pix-radio-button', function (hooks) {
module('@isDisabled', function (hooks) {
let sandbox;
hooks.beforeEach(function () {
sandbox = sinon.createSandbox();
sandbox.stub(EmberDebug, 'warn');
});

hooks.afterEach(function () {
sandbox.restore();
sandbox = sinon.stub(EmberDebug, 'warn');
});

test(`it should not be possible to interact when @isDisabled={{true}}`, async function (assert) {
Expand All @@ -57,7 +52,8 @@ module('Integration | Component | pix-radio-button', function (hooks) {
const screen = await render(
hbs`<PixRadioButton @isDisabled={{this.isDisabled}}><:label>Abricot</:label></PixRadioButton>`,
);
sandbox.assert.calledWith(

sandbox.calledWith(
EmberDebug.warn,
'PixRadioButton: @isDisabled attribute should be a boolean.',
true,
Expand Down Expand Up @@ -132,7 +128,7 @@ module('Integration | Component | pix-radio-button', function (hooks) {
const screen = await render(
hbs`<PixRadioButton @isDisabled={{this.isDisabled}}><:label>Abricot</:label></PixRadioButton>`,
);
sandbox.assert.calledWith(
sandbox.calledWith(
EmberDebug.warn,
'PixRadioButton: @isDisabled attribute should be a boolean.',
false,
Expand Down Expand Up @@ -166,7 +162,7 @@ module('Integration | Component | pix-radio-button', function (hooks) {
const screen = await render(
hbs`<PixRadioButton @isDisabled={{this.isDisabled}}><:label>Abricot</:label></PixRadioButton>`,
);
sandbox.assert.calledWith(
sandbox.calledWith(
EmberDebug.warn,
'PixRadioButton: @isDisabled attribute should be a boolean.',
true,
Expand Down

0 comments on commit efff82b

Please sign in to comment.