Skip to content

Commit

Permalink
chore: v3.21.1...v3.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LevelbossMike committed Oct 27, 2020
1 parent 4c785a4 commit 045825d
Show file tree
Hide file tree
Showing 6 changed files with 368 additions and 186 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ global application state).
Compatibility
------------------------------------------------------------------------------

* Ember.js v3.15 or above
* Ember.js v3.16 or above
* Ember CLI v2.13 or above
* Node.js v10 or above

Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"postpublish": "ember ts:clean"
},
"dependencies": {
"@glimmer/tracking": "^1.0.1",
"@glimmer/tracking": "^1.0.2",
"ember-auto-import": "^1.6.0",
"ember-cli-babel": "^7.22.1",
"ember-cli-htmlbars": "^5.3.1",
Expand All @@ -38,7 +38,7 @@
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/render-modifiers": "^1.0.2",
"@glimmer/component": "^1.0.1",
"@glimmer/component": "^1.0.2",
"@release-it/conventional-changelog": "^1.1.4",
"@types/ember": "^3.16.0",
"@types/ember-qunit": "^3.4.9",
Expand All @@ -50,7 +50,7 @@
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-angle-bracket-invocation-polyfill": "^2.0.2",
"ember-cli": "~3.21.1",
"ember-cli": "~3.22.0",
"ember-cli-addon-docs": "^0.6.16",
"ember-cli-addon-docs-esdoc": "^0.2.3",
"ember-cli-dependency-checker": "^3.2.0",
Expand All @@ -75,19 +75,19 @@
"ember-qunit": "^4.6.0",
"ember-qunit-assert-helpers": "^0.2.2",
"ember-resolver": "^8.0.2",
"ember-source": "~3.21.1",
"ember-source": "~3.22.0",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.11.0",
"ember-template-lint": "^2.14.0",
"ember-try": "^1.4.0",
"eslint": "^7.8.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-ember": "^8.13.0",
"eslint-plugin-ember": "^9.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "3.1.2",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.2",
"qunit-dom": "^1.4.0",
"qunit-dom": "^1.5.0",
"release-it": "^13.6.2",
"typescript": "^4.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "3.21.1",
"version": "3.22.0",
"blueprints": [
{
"name": "addon",
Expand Down
20 changes: 10 additions & 10 deletions tests/unit/computed-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EmberObject, { get } from '@ember/object';
import EmberObject from '@ember/object';
import { module, test } from 'qunit';
import { statechart, matchesState, debugState } from 'ember-statecharts/computed';

Expand Down Expand Up @@ -110,46 +110,46 @@ module('Unit | statechart computeds', function (hooks) {
test('can be used to match against the current state of the statechart', async function (assert) {
let { subject } = this;

assert.equal(get(subject, 'playerIsOff'), true, 'works for initial states');
assert.equal(subject.playerIsOff, true, 'works for initial states');

await subject.get('statechart').send('power');

assert.equal(get(subject, 'playerIsOn'), true, 'works after updating state');
assert.equal(subject.playerIsOn, true, 'works after updating state');

assert.equal(get(subject, 'playerIsStopped'), true, 'works for nested states');
assert.equal(subject.playerIsStopped, true, 'works for nested states');

await subject.get('statechart').send('play');

assert.equal(
get(subject, 'playerIsStopped'),
subject.playerIsStopped,
false,
'works inside of nested states - stopped false - playing again'
);
assert.equal(
get(subject, 'playerIsPlaying'),
subject.playerIsPlaying,
true,
'works inside of nested states - playing true - playing'
);

await subject.get('statechart').send('pause');

assert.equal(
get(subject, 'playerIsStopped'),
subject.playerIsStopped,
false,
'works inside of nested states - stopped false - paused'
);
assert.equal(
get(subject, 'playerIsPlaying'),
subject.playerIsPlaying,
false,
'works inside of nested states - playing false - paused'
);
assert.equal(
get(subject, 'playerIsPaused'),
subject.playerIsPaused,
true,
'works inside of nested states - paused true - paused'
);

assert.equal(get(subject, 'playerActiveMusicNotPlaying'), true, 'works when passing array');
assert.equal(subject.playerActiveMusicNotPlaying, true, 'works when passing array');
});

test('it can be used with other computeds not named `statechart`', async function (assert) {
Expand Down
22 changes: 11 additions & 11 deletions tests/unit/statechart-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EmberObject, { get } from '@ember/object';
import EmberObject from '@ember/object';
import { module, test } from 'qunit';
import { statechart } from 'ember-statecharts/computed';
import { timeout } from 'ember-concurrency';
Expand Down Expand Up @@ -43,11 +43,11 @@ module('Unit | computed | statechart', function () {

const testData = { wat: 'lol' };

assert.equal(get(subject, 'statechart.currentState.value'), 'new');
assert.equal(subject.statechart.currentState.value, 'new');

get(subject, 'statechart').send('woot', testData);
subject.statechart.send('woot', testData);

assert.equal(get(subject, 'statechart.currentState.value'), 'foo');
assert.equal(subject.statechart.currentState.value, 'foo');
});

test('it is possible to pass statechart-options to the statechart when passing an array of params', async function (assert) {
Expand Down Expand Up @@ -86,23 +86,23 @@ module('Unit | computed | statechart', function () {
}).create();

assert.equal(
get(subject, 'statechart.currentState.value'),
subject.statechart.currentState.value,
'powerOff',
'passing an array as a statechart property works'
);

await subject.get('statechart').send('power', { power: 1 });

assert.equal(
get(subject, 'statechart.currentState.value'),
subject.statechart.currentState.value,
'powerOff',
'guards will not execute transition when a falsy value is returned'
);

await subject.get('statechart').send('power', { power: 9001 });

assert.equal(
get(subject, 'statechart.currentState.value'),
subject.statechart.currentState.value,
'powerOn',
'returning a truthy from a guard executes the transition'
);
Expand Down Expand Up @@ -144,14 +144,14 @@ module('Unit | computed | statechart', function () {
},
}).create();

assert.equal(get(subject, 'statechart.currentState.value'), 'powerOff');
assert.equal(get(subject, 'offCounter'), 1, 'offCounter was incremented as expected');
assert.equal(subject.statechart.currentState.value, 'powerOff');
assert.equal(subject.offCounter, 1, 'offCounter was incremented as expected');

get(subject, 'statechart').send('POWER');
subject.statechart.send('POWER');

await timeout(300);

assert.equal(get(subject, 'statechart.currentState.value'), 'powerOn');
assert.equal(subject.statechart.currentState.value, 'powerOn');

// will fail with `calling set on destroyed object` if this doesn't work
await run(() => subject.destroy());
Expand Down
Loading

0 comments on commit 045825d

Please sign in to comment.