Skip to content
This repository was archived by the owner on Aug 2, 2024. It is now read-only.

Commit daafee0

Browse files
committed
Fix specs after qunit upgrade
1 parent dbeb57f commit daafee0

File tree

4 files changed

+14
-41
lines changed

4 files changed

+14
-41
lines changed

tests/integration/components/polaris-banner-test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ module('Integration | Component | polaris banner', function (hooks) {
296296
});
297297

298298
test('it supports `primaryAction` and `secondaryAction`', async function (assert) {
299-
assert.expect(13);
299+
assert.expect(14);
300300

301301
await render(hbs`{{polaris-banner text="Some content text"}}`);
302302

@@ -396,6 +396,11 @@ module('Integration | Component | polaris banner', function (hooks) {
396396
'banner with actions - renders correct `secondaryAction` button text'
397397
);
398398

399+
this.setProperties({
400+
mainActionLoading: false,
401+
mainActionDisabled: false,
402+
});
403+
399404
await click(primaryActionBtnSelector);
400405
await click(secondaryActionBtnSelector);
401406
});

tests/integration/components/polaris-card-test.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,11 @@ module('Integration | Component | polaris card', function (hooks) {
344344
'clicking second action button - invokes second action handler correctly'
345345
);
346346

347-
await click(actionButtons[2]);
348-
assert.equal(
349-
this.get('action3HandlerCalled'),
350-
false,
351-
'clicking disabled third action button - does not invoke third action handler'
352-
);
353347
assert
354348
.dom(actionButtons[2])
349+
.isDisabled(
350+
'third action is a disabled header action - button is disabled'
351+
)
355352
.hasClass(
356353
'Polaris-Button--disabled',
357354
'third action is a disabled header action - disabled class'

tests/integration/components/polaris-date-picker-test.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,11 @@ module('Integration | Component | polaris date picker', function (hooks) {
380380
const DISABLE_AFTER = new Date('Mon Feb 12 2018 00:00:00 GMT-0500 (EST)');
381381
const DISABLE_AFTER_SELECTOR = '[aria-label="February 13 2018"]';
382382

383-
this.set('onChangeActionFired', false);
384-
385383
this.setProperties({
386384
month: MONTH,
387385
year: YEAR,
388386
selected: null,
389387
disableDatesAfter: DISABLE_AFTER,
390-
onChange: () => {
391-
this.set('onChangeActionFired', true);
392-
},
393388
});
394389

395390
await render(hbs`
@@ -398,15 +393,12 @@ module('Integration | Component | polaris date picker', function (hooks) {
398393
year=year
399394
selected=selected
400395
disableDatesAfter=disableDatesAfter
401-
onChange=(action onChange)
402396
}}
403397
`);
404398

405-
await click(DISABLE_AFTER_SELECTOR);
406-
assert.notOk(
407-
this.get('onChangeActionFired'),
408-
'clicking disabled day did not fire `onChange` action'
409-
);
399+
assert
400+
.dom(DISABLE_AFTER_SELECTOR)
401+
.isDisabled('disabled day is rendered correctly');
410402
});
411403

412404
test('it applies an `inRange` class to days between the selected range', async function (assert) {

tests/integration/components/polaris-option-list/option-test.js

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module(
7070
await click('button');
7171
});
7272

73-
test('doesn’t call onClick if option is disabled', async function (assert) {
73+
test('supports option being disabled', async function (assert) {
7474
await render(hbs`
7575
{{polaris-option-list/option
7676
optionId=defaultProps.id
@@ -83,9 +83,7 @@ module(
8383
}}
8484
`);
8585

86-
await click('button');
87-
88-
assert.notOk(this.get('wasOnClickCalled'));
86+
assert.dom('button').isDisabled();
8987
});
9088

9189
test('calls onClick with section and index if option is not disabled and multiple options are allowed', async function (assert) {
@@ -112,25 +110,6 @@ module(
112110
await triggerEvent('input', 'change');
113111
});
114112

115-
test('doesn’t call onClick if option is disabled and multiple options are allowed', async function (assert) {
116-
await render(hbs`
117-
{{polaris-option-list/option
118-
optionId=defaultProps.id
119-
label=defaultProps.label
120-
value=defaultProps.value
121-
section=defaultProps.section
122-
index=defaultProps.index
123-
onClick=(action (mut wasOnClickCalled) true)
124-
disabled=true
125-
allowMultiple=true
126-
}}
127-
`);
128-
129-
await triggerEvent('input', 'change');
130-
131-
assert.notOk(this.get('wasOnClickCalled'));
132-
});
133-
134113
test('sets the pass through props for Checkbox if multiple items are allowed', async function (assert) {
135114
await render(hbs`
136115
{{polaris-option-list/option

0 commit comments

Comments
 (0)