refactor: 💡 upgrade addons/api to Ember 3.24

This commit is contained in:
Randall Morey committed 2021-03-04 15:47:38 -05:00
1 parent 050c2577d0
commit fbf39b3bba
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);
+4 -16
View File
@@ -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',
+9 -9
View File
@@ -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');
});
+14 -10
View File
@@ -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,