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

Commit c9b4362

Browse files
authored
Merge pull request #693 from smile-io/renovate/major-ember-deps
Update dependency ember-qunit to v5
2 parents 310d084 + daafee0 commit c9b4362

File tree

8 files changed

+128
-133
lines changed

8 files changed

+128
-133
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
},
7878
"devDependencies": {
7979
"@ember/optional-features": "2.0.0",
80+
"@ember/test-helpers": "^2.1.4",
8081
"@glimmer/component": "1.0.3",
8182
"@glimmer/tracking": "1.0.3",
8283
"@smile-io/changelog-generator": "2.1.0",
@@ -96,7 +97,7 @@
9697
"ember-export-application-global": "2.0.1",
9798
"ember-load-initializers": "2.1.2",
9899
"ember-maybe-import-regenerator": "0.1.6",
99-
"ember-qunit": "4.6.0",
100+
"ember-qunit": "5.1.1",
100101
"ember-resolver": "8.0.2",
101102
"ember-source": "3.24.0",
102103
"ember-source-channel-url": "3.0.0",
@@ -114,6 +115,7 @@
114115
"npm-run-all": "4.1.5",
115116
"precise-commits": "1.0.2",
116117
"prettier": "2.2.1",
118+
"qunit": "^2.13.0",
117119
"qunit-dom": "1.6.0"
118120
},
119121
"engines": {

tests/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
{{content-for "body"}}
2222
{{content-for "test-body"}}
2323

24+
<div id="qunit"></div>
25+
<div id="qunit-fixture">
26+
<div id="ember-testing-container">
27+
<div id="ember-testing"></div>
28+
</div>
29+
</div>
30+
2431
<script src="/testem.js" integrity=""></script>
2532
<script src="{{rootURL}}assets/vendor.js"></script>
2633
<script src="{{rootURL}}assets/test-support.js"></script>

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

tests/test-helper.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import Application from 'dummy/app';
22
import config from 'dummy/config/environment';
33
import { setApplication } from '@ember/test-helpers';
44
import { start } from 'ember-qunit';
5+
import * as QUnit from 'qunit';
6+
import { setup } from 'qunit-dom';
7+
8+
setup(QUnit.assert);
59

610
setApplication(Application.create(config.APP));
711

0 commit comments

Comments
 (0)