refactor: 💡 upgrade addons/api to Ember 3.24
This commit is contained in:
92 files changed
+1348
-621
No files matched your search
@@ -21,5 +21,4 @@ module('Unit | Model | account', function (hooks) {
|
||||
model.attributes.login_name = 'username';
|
||||
assert.equal(model.username, 'username');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -1,11 +1,11 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Model | auth token', function(hooks) {
|
||||
module('Unit | Model | auth token', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
test('it exists', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('auth-token', {});
|
||||
assert.ok(model);
|
||||
|
||||
@@ -24,10 +24,7 @@ module('Unit | Model | host set', function (hooks) {
|
||||
attributes: {
|
||||
name: 'Host Set',
|
||||
description: 'Description',
|
||||
host_ids: [
|
||||
{value: '1'},
|
||||
{value: '3'},
|
||||
],
|
||||
host_ids: [{ value: '1' }, { value: '3' }],
|
||||
version: 1,
|
||||
scope: {
|
||||
scope_id: 'o_1',
|
||||
@@ -58,10 +55,7 @@ module('Unit | Model | host set', function (hooks) {
|
||||
attributes: {
|
||||
name: 'Host Set',
|
||||
description: 'Description',
|
||||
host_ids: [
|
||||
{value: '1'},
|
||||
{value: '3'},
|
||||
],
|
||||
host_ids: [{ value: '1' }, { value: '3' }],
|
||||
version: 1,
|
||||
scope: {
|
||||
scope_id: 'o_1',
|
||||
@@ -92,10 +86,7 @@ module('Unit | Model | host set', function (hooks) {
|
||||
attributes: {
|
||||
name: 'Host Set',
|
||||
description: 'Description',
|
||||
host_ids: [
|
||||
{value: '1'},
|
||||
{value: '3'},
|
||||
],
|
||||
host_ids: [{ value: '1' }, { value: '3' }],
|
||||
version: 1,
|
||||
scope: {
|
||||
scope_id: 'o_1',
|
||||
@@ -126,10 +117,7 @@ module('Unit | Model | host set', function (hooks) {
|
||||
attributes: {
|
||||
name: 'Host Set',
|
||||
description: 'Description',
|
||||
host_ids: [
|
||||
{value: '1'},
|
||||
{value: '3'},
|
||||
],
|
||||
host_ids: [{ value: '1' }, { value: '3' }],
|
||||
version: 1,
|
||||
scope: {
|
||||
scope_id: 'o_1',
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Model | session', function(hooks) {
|
||||
module('Unit | Model | session', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function(assert) {
|
||||
test('it exists', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('session', {});
|
||||
assert.ok(model);
|
||||
assert.notOk(model.isCancelable);
|
||||
});
|
||||
|
||||
test('it allows cancellation of an active session', function(assert) {
|
||||
test('it allows cancellation of an active session', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('session', {
|
||||
status: 'active'
|
||||
status: 'active',
|
||||
});
|
||||
assert.ok(model.isCancelable);
|
||||
});
|
||||
|
||||
test('it allows cancellation of a pending session', function(assert) {
|
||||
test('it allows cancellation of a pending session', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('session', {
|
||||
status: 'pending'
|
||||
status: 'pending',
|
||||
});
|
||||
assert.ok(model.isCancelable);
|
||||
});
|
||||
@@ -31,7 +31,7 @@ module('Unit | Model | session', function(hooks) {
|
||||
assert.expect(2);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('session', {
|
||||
status: 'pending'
|
||||
status: 'pending',
|
||||
});
|
||||
assert.notOk(model.isActive);
|
||||
model.status = 'active';
|
||||
@@ -42,7 +42,7 @@ module('Unit | Model | session', function(hooks) {
|
||||
assert.expect(2);
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('session', {
|
||||
status: 'active'
|
||||
status: 'active',
|
||||
});
|
||||
assert.notOk(model.isPending);
|
||||
model.status = 'pending';
|
||||
@@ -55,7 +55,7 @@ module('Unit | Model | session', function(hooks) {
|
||||
assert.equal(model.proxy, null);
|
||||
model.setProperties({
|
||||
proxy_address: 'localhost',
|
||||
proxy_port: '12345'
|
||||
proxy_port: '12345',
|
||||
});
|
||||
assert.equal(model.proxy, 'localhost:12345');
|
||||
});
|
||||
|
||||
@@ -186,33 +186,37 @@ module('Unit | Model | target', function (hooks) {
|
||||
store.push({
|
||||
data: {
|
||||
id: '123abc',
|
||||
type: 'target'
|
||||
}
|
||||
type: 'target',
|
||||
},
|
||||
});
|
||||
const target = store.peekRecord('target', '123abc');
|
||||
assert.equal( target.sessions.length, 0);
|
||||
assert.equal(target.sessions.length, 0);
|
||||
store.push({
|
||||
data: {
|
||||
id: '1',
|
||||
type: 'session',
|
||||
attributes: { target_id: '123abc' }
|
||||
}
|
||||
attributes: { target_id: '123abc' },
|
||||
},
|
||||
});
|
||||
store.push({
|
||||
data: {
|
||||
id: '2',
|
||||
type: 'session',
|
||||
attributes: { target_id: '123abc' }
|
||||
}
|
||||
attributes: { target_id: '123abc' },
|
||||
},
|
||||
});
|
||||
store.push({
|
||||
data: {
|
||||
id: '3',
|
||||
type: 'session',
|
||||
attributes: { target_id: '456xyz' }
|
||||
}
|
||||
attributes: { target_id: '456xyz' },
|
||||
},
|
||||
});
|
||||
assert.equal(store.peekAll('session').length, 3, 'There are 3 sessions loaded in the store');
|
||||
assert.equal(
|
||||
store.peekAll('session').length,
|
||||
3,
|
||||
'There are 3 sessions loaded in the store'
|
||||
);
|
||||
assert.equal(
|
||||
target.sessions.length,
|
||||
2,
|
||||
|
||||
Reference in new issue
Block a user