Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ember-macro-test-helpers to the latest version 🚀 #12

Merged
merged 2 commits into from
Dec 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"ember-disable-prototype-extensions": "^1.1.0",
"ember-export-application-global": "^1.0.5",
"ember-load-initializers": "^0.6.3",
"ember-macro-test-helpers": "^1.0.0",
"ember-macro-test-helpers": "^2.0.0",
"ember-resolver": "^2.0.3",
"ember-sinon": "0.6.0",
"loader.js": "^4.0.10"
Expand Down
28 changes: 14 additions & 14 deletions tests/integration/computed-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ function alias(key) {
});

test('function syntax: uses the right context when getting', function(assert) {
let { obj } = compute({
let { subject } = compute({
computed: computed(getCallback)
});

assert.strictEqual(getCallback.thisValues[0], obj);
assert.strictEqual(getCallback.thisValues[0], subject);
});

test('function syntax: passes the values when getting', function(assert) {
Expand All @@ -81,37 +81,37 @@ function alias(key) {
});

test('function syntax: doesn\'t call when setting', function(assert) {
let { obj } = compute({
let { subject } = compute({
computed: computed(getCallback)
});

getCallback.reset();

obj.set('computed', newValue);
subject.set('computed', newValue);

assert.notOk(getCallback.called);
});

test('function syntax: preserves set value', function(assert) {
let { obj } = compute({
let { subject } = compute({
computed: computed(getCallback)
});

getCallback.reset();

obj.set('computed', newValue);
subject.set('computed', newValue);

assert.strictEqual(obj.get('computed'), newValue);
assert.strictEqual(subject.get('computed'), newValue);
});

test('object syntax: uses the right context when getting', function(assert) {
let { obj } = compute({
let { subject } = compute({
computed: computed({
get: getCallback
})
});

assert.strictEqual(getCallback.thisValues[0], obj);
assert.strictEqual(getCallback.thisValues[0], subject);
});

test('object syntax: passes the values when getting', function(assert) {
Expand All @@ -129,27 +129,27 @@ function alias(key) {
});

test('object syntax: uses the right context when setting', function(assert) {
let { obj } = compute({
let { subject } = compute({
computed: computed({
get: getCallback,
set: setCallback
})
});

obj.set('computed', newValue);
subject.set('computed', newValue);

assert.strictEqual(setCallback.thisValues[0], obj);
assert.strictEqual(setCallback.thisValues[0], subject);
});

test('object syntax: passes the key, value, and previous value when setting', function(assert) {
let { obj } = compute({
let { subject } = compute({
computed: computed({
get: getCallback,
set: setCallback
})
});

obj.set('computed', newValue);
subject.set('computed', newValue);

assert.deepEqual(setCallback.args, [['computed', newValue, returnValue]]);
});
Expand Down