diff --git a/ui-v2/app/routes/application.js b/ui-v2/app/routes/application.js index 2f17c18c4f..662ea9a669 100644 --- a/ui-v2/app/routes/application.js +++ b/ui-v2/app/routes/application.js @@ -11,7 +11,7 @@ export default Route.extend({ init: function() { this._super(...arguments); }, - repo: service('dc'), + repo: service('repository/dc'), actions: { loading: function(transition, originRoute) { let dc = null; diff --git a/ui-v2/app/routes/dc.js b/ui-v2/app/routes/dc.js index 5d51eb057b..6b8f466a46 100644 --- a/ui-v2/app/routes/dc.js +++ b/ui-v2/app/routes/dc.js @@ -3,7 +3,7 @@ import { inject as service } from '@ember/service'; import { hash } from 'rsvp'; import { get } from '@ember/object'; export default Route.extend({ - repo: service('dc'), + repo: service('repository/dc'), settings: service('settings'), model: function(params) { const repo = get(this, 'repo'); diff --git a/ui-v2/app/routes/dc/acls/create.js b/ui-v2/app/routes/dc/acls/create.js index ee36d06030..315a07fb60 100644 --- a/ui-v2/app/routes/dc/acls/create.js +++ b/ui-v2/app/routes/dc/acls/create.js @@ -7,7 +7,7 @@ import WithAclActions from 'consul-ui/mixins/acl/with-actions'; export default Route.extend(WithAclActions, { templateName: 'dc/acls/edit', - repo: service('acls'), + repo: service('repository/acl'), beforeModel: function() { get(this, 'repo').invalidate(); }, diff --git a/ui-v2/app/routes/dc/acls/edit.js b/ui-v2/app/routes/dc/acls/edit.js index 078aa4afc4..565f90bbe7 100644 --- a/ui-v2/app/routes/dc/acls/edit.js +++ b/ui-v2/app/routes/dc/acls/edit.js @@ -6,7 +6,7 @@ import { get } from '@ember/object'; import WithAclActions from 'consul-ui/mixins/acl/with-actions'; export default Route.extend(WithAclActions, { - repo: service('acls'), + repo: service('repository/acl'), settings: service('settings'), model: function(params) { return hash({ diff --git a/ui-v2/app/routes/dc/acls/index.js b/ui-v2/app/routes/dc/acls/index.js index 6e7804d6b2..a2fa9d3631 100644 --- a/ui-v2/app/routes/dc/acls/index.js +++ b/ui-v2/app/routes/dc/acls/index.js @@ -6,7 +6,7 @@ import { get } from '@ember/object'; import WithAclActions from 'consul-ui/mixins/acl/with-actions'; export default Route.extend(WithAclActions, { - repo: service('acls'), + repo: service('repository/acl'), queryParams: { s: { as: 'filter', diff --git a/ui-v2/app/routes/dc/intentions/create.js b/ui-v2/app/routes/dc/intentions/create.js index e2e57dc8fe..a52a8429d5 100644 --- a/ui-v2/app/routes/dc/intentions/create.js +++ b/ui-v2/app/routes/dc/intentions/create.js @@ -6,8 +6,8 @@ import WithIntentionActions from 'consul-ui/mixins/intention/with-actions'; export default Route.extend(WithIntentionActions, { templateName: 'dc/intentions/edit', - repo: service('intentions'), - servicesRepo: service('services'), + repo: service('repository/intention'), + servicesRepo: service('repository/service'), beforeModel: function() { get(this, 'repo').invalidate(); }, diff --git a/ui-v2/app/routes/dc/intentions/edit.js b/ui-v2/app/routes/dc/intentions/edit.js index 91c6b9f09a..16b085dbe9 100644 --- a/ui-v2/app/routes/dc/intentions/edit.js +++ b/ui-v2/app/routes/dc/intentions/edit.js @@ -6,8 +6,8 @@ import { get } from '@ember/object'; import WithAclActions from 'consul-ui/mixins/intention/with-actions'; export default Route.extend(WithAclActions, { - repo: service('intentions'), - servicesRepo: service('services'), + repo: service('repository/intention'), + servicesRepo: service('repository/service'), model: function(params) { return hash({ isLoading: false, diff --git a/ui-v2/app/routes/dc/intentions/index.js b/ui-v2/app/routes/dc/intentions/index.js index cffb068305..ec41bf54aa 100644 --- a/ui-v2/app/routes/dc/intentions/index.js +++ b/ui-v2/app/routes/dc/intentions/index.js @@ -6,7 +6,7 @@ import { get } from '@ember/object'; import WithIntentionActions from 'consul-ui/mixins/intention/with-actions'; export default Route.extend(WithIntentionActions, { - repo: service('intentions'), + repo: service('repository/intention'), queryParams: { s: { as: 'filter', diff --git a/ui-v2/app/routes/dc/kv/create.js b/ui-v2/app/routes/dc/kv/create.js index 37ab4e0380..44ec169e58 100644 --- a/ui-v2/app/routes/dc/kv/create.js +++ b/ui-v2/app/routes/dc/kv/create.js @@ -6,7 +6,7 @@ import WithKvActions from 'consul-ui/mixins/kv/with-actions'; export default Route.extend(WithKvActions, { templateName: 'dc/kv/edit', - repo: service('kv'), + repo: service('repository/kv'), beforeModel: function() { get(this, 'repo').invalidate(); }, diff --git a/ui-v2/app/routes/dc/kv/edit.js b/ui-v2/app/routes/dc/kv/edit.js index 2cae409548..170e512f6a 100644 --- a/ui-v2/app/routes/dc/kv/edit.js +++ b/ui-v2/app/routes/dc/kv/edit.js @@ -7,8 +7,8 @@ import WithKvActions from 'consul-ui/mixins/kv/with-actions'; import ascend from 'consul-ui/utils/ascend'; export default Route.extend(WithKvActions, { - repo: service('kv'), - sessionRepo: service('session'), + repo: service('repository/kv'), + sessionRepo: service('repository/session'), model: function(params) { const key = params.key; const dc = this.modelFor('dc').dc.Name; diff --git a/ui-v2/app/routes/dc/kv/index.js b/ui-v2/app/routes/dc/kv/index.js index 10ce8ae1cc..21ef89dc05 100644 --- a/ui-v2/app/routes/dc/kv/index.js +++ b/ui-v2/app/routes/dc/kv/index.js @@ -12,7 +12,7 @@ export default Route.extend(WithKvActions, { replace: true, }, }, - repo: service('kv'), + repo: service('repository/kv'), beforeModel: function() { // we are index or folder, so if the key doesn't have a trailing slash // add one to force a fake findBySlug diff --git a/ui-v2/app/routes/dc/nodes/index.js b/ui-v2/app/routes/dc/nodes/index.js index 6b71d287ac..5488397458 100644 --- a/ui-v2/app/routes/dc/nodes/index.js +++ b/ui-v2/app/routes/dc/nodes/index.js @@ -4,7 +4,7 @@ import { hash } from 'rsvp'; import { get } from '@ember/object'; export default Route.extend({ - repo: service('nodes'), + repo: service('repository/node'), queryParams: { s: { as: 'filter', diff --git a/ui-v2/app/routes/dc/nodes/show.js b/ui-v2/app/routes/dc/nodes/show.js index b13402edc8..9d9f344588 100644 --- a/ui-v2/app/routes/dc/nodes/show.js +++ b/ui-v2/app/routes/dc/nodes/show.js @@ -10,8 +10,8 @@ import WithBlockingActions from 'consul-ui/mixins/with-blocking-actions'; const tomography = tomographyFactory(distance); export default Route.extend(WithBlockingActions, { - repo: service('nodes'), - sessionRepo: service('session'), + repo: service('repository/node'), + sessionRepo: service('repository/session'), queryParams: { s: { as: 'filter', diff --git a/ui-v2/app/routes/dc/services/index.js b/ui-v2/app/routes/dc/services/index.js index 22fcad990a..7b74816dbd 100644 --- a/ui-v2/app/routes/dc/services/index.js +++ b/ui-v2/app/routes/dc/services/index.js @@ -4,7 +4,7 @@ import { hash } from 'rsvp'; import { get } from '@ember/object'; export default Route.extend({ - repo: service('services'), + repo: service('repository/service'), queryParams: { s: { as: 'filter', diff --git a/ui-v2/app/routes/dc/services/show.js b/ui-v2/app/routes/dc/services/show.js index 2fa74c8dd2..bf5fa0d657 100644 --- a/ui-v2/app/routes/dc/services/show.js +++ b/ui-v2/app/routes/dc/services/show.js @@ -4,7 +4,7 @@ import { hash } from 'rsvp'; import { get } from '@ember/object'; export default Route.extend({ - repo: service('services'), + repo: service('repository/service'), queryParams: { s: { as: 'filter', diff --git a/ui-v2/app/routes/index.js b/ui-v2/app/routes/index.js index 05776118ec..022551c4e3 100644 --- a/ui-v2/app/routes/index.js +++ b/ui-v2/app/routes/index.js @@ -4,7 +4,7 @@ import { hash } from 'rsvp'; import { get } from '@ember/object'; export default Route.extend({ - repo: service('dc'), + repo: service('repository/dc'), model: function(params) { return hash({ item: get(this, 'repo').getActive(), diff --git a/ui-v2/app/routes/settings.js b/ui-v2/app/routes/settings.js index e7b07115c2..c5f9701b61 100644 --- a/ui-v2/app/routes/settings.js +++ b/ui-v2/app/routes/settings.js @@ -6,7 +6,7 @@ import { get } from '@ember/object'; import WithBlockingActions from 'consul-ui/mixins/with-blocking-actions'; export default Route.extend(WithBlockingActions, { repo: service('settings'), - dcRepo: service('dc'), + dcRepo: service('repository/dc'), model: function(params) { return hash({ item: get(this, 'repo').findAll(), diff --git a/ui-v2/app/services/acls.js b/ui-v2/app/services/acls.js deleted file mode 100644 index 5249f1d74a..0000000000 --- a/ui-v2/app/services/acls.js +++ /dev/null @@ -1,42 +0,0 @@ -import Service, { inject as service } from '@ember/service'; -import { get } from '@ember/object'; -import { typeOf } from '@ember/utils'; -import { PRIMARY_KEY } from 'consul-ui/models/acl'; -export default Service.extend({ - store: service('store'), - clone: function(item) { - return get(this, 'store').clone('acl', get(item, PRIMARY_KEY)); - }, - findAllByDatacenter: function(dc) { - return get(this, 'store').query('acl', { - dc: dc, - }); - }, - findBySlug: function(slug, dc) { - return get(this, 'store').queryRecord('acl', { - id: slug, - dc: dc, - }); - }, - create: function() { - return get(this, 'store').createRecord('acl'); - }, - persist: function(item) { - return item.save(); - }, - remove: function(obj) { - let item = obj; - if (typeof obj.destroyRecord === 'undefined') { - item = obj.get('data'); - } - if (typeOf(item) === 'object') { - item = get(this, 'store').peekRecord('acl', item[PRIMARY_KEY]); - } - return item.destroyRecord().then(item => { - return get(this, 'store').unloadRecord(item); - }); - }, - invalidate: function() { - get(this, 'store').unloadAll('acl'); - }, -}); diff --git a/ui-v2/app/services/coordinates.js b/ui-v2/app/services/coordinates.js deleted file mode 100644 index 85dea8ea66..0000000000 --- a/ui-v2/app/services/coordinates.js +++ /dev/null @@ -1,9 +0,0 @@ -import Service, { inject as service } from '@ember/service'; -import { get } from '@ember/object'; - -export default Service.extend({ - store: service('store'), - findAllByDatacenter: function(dc) { - return get(this, 'store').query('coordinate', { dc: dc }); - }, -}); diff --git a/ui-v2/app/services/intentions.js b/ui-v2/app/services/intentions.js deleted file mode 100644 index 5d87bdfcdf..0000000000 --- a/ui-v2/app/services/intentions.js +++ /dev/null @@ -1,37 +0,0 @@ -import Service, { inject as service } from '@ember/service'; -import { get } from '@ember/object'; -import { typeOf } from '@ember/utils'; -import { PRIMARY_KEY } from 'consul-ui/models/intention'; -export default Service.extend({ - store: service('store'), - findAllByDatacenter: function(dc) { - return get(this, 'store').query('intention', { dc: dc }); - }, - findBySlug: function(slug, dc) { - return get(this, 'store').queryRecord('intention', { - id: slug, - dc: dc, - }); - }, - create: function() { - return get(this, 'store').createRecord('intention'); - }, - persist: function(item) { - return item.save(); - }, - remove: function(obj) { - let item = obj; - if (typeof obj.destroyRecord === 'undefined') { - item = obj.get('data'); - } - if (typeOf(item) === 'object') { - item = get(this, 'store').peekRecord('intention', item[PRIMARY_KEY]); - } - return item.destroyRecord().then(item => { - return get(this, 'store').unloadRecord(item); - }); - }, - invalidate: function() { - return get(this, 'store').unloadAll('intention'); - }, -}); diff --git a/ui-v2/app/services/nodes.js b/ui-v2/app/services/nodes.js deleted file mode 100644 index e7ed82fac9..0000000000 --- a/ui-v2/app/services/nodes.js +++ /dev/null @@ -1,24 +0,0 @@ -import Service, { inject as service } from '@ember/service'; -import { get } from '@ember/object'; -export default Service.extend({ - store: service('store'), - coordinates: service('coordinates'), - findAllByDatacenter: function(dc) { - return get(this, 'store').query('node', { dc: dc }); - }, - findBySlug: function(slug, dc) { - return get(this, 'store') - .queryRecord('node', { - id: slug, - dc: dc, - }) - .then(node => { - return get(this, 'coordinates') - .findAllByDatacenter(dc) - .then(function(res) { - node.Coordinates = res; - return node; - }); - }); - }, -}); diff --git a/ui-v2/app/services/repository.js b/ui-v2/app/services/repository.js new file mode 100644 index 0000000000..f7fe5ac0e1 --- /dev/null +++ b/ui-v2/app/services/repository.js @@ -0,0 +1,50 @@ +import Service, { inject as service } from '@ember/service'; +import { get } from '@ember/object'; +import { assert } from '@ember/debug'; +import { typeOf } from '@ember/utils'; +export default Service.extend({ + getModelName: function() { + assert('RepositoryService.getModelName should be overridden', false); + }, + getPrimaryKey: function() { + assert('RepositoryService.getPrimaryKey should be overridden', false); + }, + getSlugKey: function() { + assert('RepositoryService.getSlugKey should be overridden', false); + }, + // + store: service('store'), + findAllByDatacenter: function(dc) { + return get(this, 'store').query(this.getModelName(), { + dc: dc, + }); + }, + findBySlug: function(slug, dc) { + return get(this, 'store').queryRecord(this.getModelName(), { + id: slug, + dc: dc, + }); + }, + create: function(obj) { + // TODO: This should probably return a Promise + return get(this, 'store').createRecord(this.getModelName(), obj); + }, + persist: function(item) { + return item.save(); + }, + remove: function(obj) { + let item = obj; + if (typeof obj.destroyRecord === 'undefined') { + item = obj.get('data'); + } + if (typeOf(item) === 'object') { + item = get(this, 'store').peekRecord(this.getModelName(), item[this.getPrimaryKey()]); + } + return item.destroyRecord().then(item => { + return get(this, 'store').unloadRecord(item); + }); + }, + invalidate: function() { + get(this, 'store').unloadAll(this.getModelName()); + }, +}); diff --git a/ui-v2/app/services/repository/acl.js b/ui-v2/app/services/repository/acl.js new file mode 100644 index 0000000000..0fc28ae6ab --- /dev/null +++ b/ui-v2/app/services/repository/acl.js @@ -0,0 +1,15 @@ +import RepositoryService from 'consul-ui/services/repository'; +import { get } from '@ember/object'; +import { PRIMARY_KEY } from 'consul-ui/models/acl'; +const modelName = 'acl'; +export default RepositoryService.extend({ + getModelName: function() { + return modelName; + }, + getPrimaryKey: function() { + return PRIMARY_KEY; + }, + clone: function(item) { + return get(this, 'store').clone(this.getModelName(), get(item, this.getPrimaryKey())); + }, +}); diff --git a/ui-v2/app/services/repository/coordinate.js b/ui-v2/app/services/repository/coordinate.js new file mode 100644 index 0000000000..f6f5c1d8e6 --- /dev/null +++ b/ui-v2/app/services/repository/coordinate.js @@ -0,0 +1,8 @@ +import RepositoryService from 'consul-ui/services/repository'; + +const modelName = 'coordinate'; +export default RepositoryService.extend({ + getModelName: function() { + return modelName; + }, +}); diff --git a/ui-v2/app/services/dc.js b/ui-v2/app/services/repository/dc.js similarity index 82% rename from ui-v2/app/services/dc.js rename to ui-v2/app/services/repository/dc.js index 43e96c99bb..f2e5f3e59a 100644 --- a/ui-v2/app/services/dc.js +++ b/ui-v2/app/services/repository/dc.js @@ -1,10 +1,21 @@ -import Service, { inject as service } from '@ember/service'; +import RepositoryService from 'consul-ui/services/repository'; +import { inject as service } from '@ember/service'; import { get } from '@ember/object'; import Error from '@ember/error'; -export default Service.extend({ - store: service('store'), +const modelName = 'dc'; +export default RepositoryService.extend({ settings: service('settings'), + getModelName: function() { + return modelName; + }, + findAll: function() { + return get(this, 'store') + .findAll(this.getModelName()) + .then(function(items) { + return items.sortBy('Name'); + }); + }, findBySlug: function(name, items) { if (name != null) { const item = items.findBy('Name', name); @@ -34,11 +45,4 @@ export default Service.extend({ } ); }, - findAll: function() { - return get(this, 'store') - .findAll('dc') - .then(function(items) { - return items.sortBy('Name'); - }); - }, }); diff --git a/ui-v2/app/services/repository/intention.js b/ui-v2/app/services/repository/intention.js new file mode 100644 index 0000000000..7df0cb8a57 --- /dev/null +++ b/ui-v2/app/services/repository/intention.js @@ -0,0 +1,11 @@ +import RepositoryService from 'consul-ui/services/repository'; +import { PRIMARY_KEY } from 'consul-ui/models/intention'; +const modelName = 'intention'; +export default RepositoryService.extend({ + getModelName: function() { + return modelName; + }, + getPrimaryKey: function() { + return PRIMARY_KEY; + }, +}); diff --git a/ui-v2/app/services/kv.js b/ui-v2/app/services/repository/kv.js similarity index 56% rename from ui-v2/app/services/kv.js rename to ui-v2/app/services/repository/kv.js index 0f903b537b..6185c9022e 100644 --- a/ui-v2/app/services/kv.js +++ b/ui-v2/app/services/repository/kv.js @@ -1,17 +1,22 @@ -import Service, { inject as service } from '@ember/service'; -import { typeOf } from '@ember/utils'; +import RepositoryService from 'consul-ui/services/repository'; import { Promise } from 'rsvp'; import isFolder from 'consul-ui/utils/isFolder'; import { get, set } from '@ember/object'; import { PRIMARY_KEY } from 'consul-ui/models/kv'; -export default Service.extend({ - store: service('store'), +const modelName = 'kv'; +export default RepositoryService.extend({ + getModelName: function() { + return modelName; + }, + getPrimaryKey: function() { + return PRIMARY_KEY; + }, // this one gives you the full object so key,values and meta findBySlug: function(key, dc) { if (isFolder(key)) { const id = JSON.stringify([dc, key]); - let item = get(this, 'store').peekRecord('kv', id); + let item = get(this, 'store').peekRecord(this.getModelName(), id); if (!item) { item = this.create(); set(item, 'Key', key); @@ -19,7 +24,7 @@ export default Service.extend({ } return Promise.resolve(item); } - return get(this, 'store').queryRecord('kv', { + return get(this, 'store').queryRecord(this.getModelName(), { id: key, dc: dc, }); @@ -31,7 +36,7 @@ export default Service.extend({ key = ''; } return this.get('store') - .query('kv', { + .query(this.getModelName(), { id: key, dc: dc, separator: '/', @@ -44,7 +49,7 @@ export default Service.extend({ .catch(e => { if (e.errors && e.errors[0] && e.errors[0].status == '404') { const id = JSON.stringify([dc, key]); - const record = get(this, 'store').peekRecord('kv', id); + const record = get(this, 'store').peekRecord(this.getModelName(), id); if (record) { record.destroyRecord(); } @@ -52,25 +57,4 @@ export default Service.extend({ throw e; }); }, - create: function() { - return get(this, 'store').createRecord('kv'); - }, - persist: function(item) { - return item.save(); - }, - remove: function(obj) { - let item = obj; - if (typeof obj.destroyRecord === 'undefined') { - item = obj.get('data'); - } - if (typeOf(item) === 'object') { - item = get(this, 'store').peekRecord('kv', item[PRIMARY_KEY]); - } - return item.destroyRecord().then(item => { - return get(this, 'store').unloadRecord(item); - }); - }, - invalidate: function() { - return get(this, 'store').unloadAll('kv'); - }, }); diff --git a/ui-v2/app/services/repository/node.js b/ui-v2/app/services/repository/node.js new file mode 100644 index 0000000000..0d7eb57344 --- /dev/null +++ b/ui-v2/app/services/repository/node.js @@ -0,0 +1,20 @@ +import RepositoryService from 'consul-ui/services/repository'; +import { inject as service } from '@ember/service'; +import { get } from '@ember/object'; +const modelName = 'node'; +export default RepositoryService.extend({ + coordinates: service('repository/coordinate'), + getModelName: function() { + return modelName; + }, + findBySlug: function(slug, dc) { + return this._super(...arguments).then(node => { + return get(this, 'coordinates') + .findAllByDatacenter(dc) + .then(function(res) { + node.Coordinates = res; + return node; + }); + }); + }, +}); diff --git a/ui-v2/app/services/services.js b/ui-v2/app/services/repository/service.js similarity index 56% rename from ui-v2/app/services/services.js rename to ui-v2/app/services/repository/service.js index 254008c62a..5654c3a618 100644 --- a/ui-v2/app/services/services.js +++ b/ui-v2/app/services/repository/service.js @@ -1,18 +1,12 @@ -import Service, { inject as service } from '@ember/service'; +import RepositoryService from 'consul-ui/services/repository'; import { get, set } from '@ember/object'; - -export default Service.extend({ - store: service('store'), - findAllByDatacenter: function(dc) { - return get(this, 'store').query('service', { dc: dc }); +const modelName = 'service'; +export default RepositoryService.extend({ + getModelName: function() { + return modelName; }, findBySlug: function(slug, dc) { - return get(this, 'store') - .queryRecord('service', { - id: slug, - dc: dc, - }) - .then(function(item) { + return this._super(...arguments).then(function(item) { const nodes = get(item, 'Nodes'); const service = get(nodes, 'firstObject'); const tags = nodes diff --git a/ui-v2/app/services/repository/session.js b/ui-v2/app/services/repository/session.js new file mode 100644 index 0000000000..9dace862dd --- /dev/null +++ b/ui-v2/app/services/repository/session.js @@ -0,0 +1,21 @@ +import RepositoryService from 'consul-ui/services/repository'; +import { inject as service } from '@ember/service'; +import { get } from '@ember/object'; + +const modelName = 'session'; +export default RepositoryService.extend({ + store: service('store'), + getModelName: function() { + return modelName; + }, + findByNode: function(node, dc) { + return get(this, 'store').query(this.getModelName(), { + id: node, + dc: dc, + }); + }, + // TODO: Why Key? Probably should be findBySlug like the others + findByKey: function(slug, dc) { + return this.findBySlug(slug, dc); + }, +}); diff --git a/ui-v2/app/services/session.js b/ui-v2/app/services/session.js deleted file mode 100644 index 9260bd003f..0000000000 --- a/ui-v2/app/services/session.js +++ /dev/null @@ -1,24 +0,0 @@ -import Service, { inject as service } from '@ember/service'; -import { get } from '@ember/object'; - -export default Service.extend({ - store: service('store'), - findByNode: function(node, dc) { - return get(this, 'store').query('session', { - id: node, - dc: dc, - }); - }, - // TODO: Why Key? Probably should be findBySlug like the others - findByKey: function(slug, dc) { - return get(this, 'store').queryRecord('session', { - id: slug, - dc: dc, - }); - }, - remove: function(item) { - return item.destroyRecord().then(item => { - return get(this, 'store').unloadRecord(item); - }); - }, -}); diff --git a/ui-v2/tests/integration/services/acls-test.js b/ui-v2/tests/integration/services/repository/acl-test.js similarity index 91% rename from ui-v2/tests/integration/services/acls-test.js rename to ui-v2/tests/integration/services/repository/acl-test.js index 4902b55ef5..f5b707e0bb 100644 --- a/ui-v2/tests/integration/services/acls-test.js +++ b/ui-v2/tests/integration/services/repository/acl-test.js @@ -1,8 +1,9 @@ import { moduleFor, test } from 'ember-qunit'; import repo from 'consul-ui/tests/helpers/repo'; -moduleFor('service:acls', 'Integration | Service | acls', { +const NAME = 'acl'; +moduleFor(`service:repository/${NAME}`, `Integration | Service | ${NAME}`, { // Specify the other units that are required for this test. - needs: ['service:store', 'model:acl', 'adapter:acl', 'serializer:acl', 'service:settings'], + integration: true }); const dc = 'dc-1'; const id = 'token-name'; diff --git a/ui-v2/tests/integration/services/coordinates-test.js b/ui-v2/tests/integration/services/repository/coordinate-test.js similarity index 82% rename from ui-v2/tests/integration/services/coordinates-test.js rename to ui-v2/tests/integration/services/repository/coordinate-test.js index 2fbf162f0b..1c0f07f7f0 100644 --- a/ui-v2/tests/integration/services/coordinates-test.js +++ b/ui-v2/tests/integration/services/repository/coordinate-test.js @@ -1,15 +1,9 @@ import { moduleFor, test } from 'ember-qunit'; import repo from 'consul-ui/tests/helpers/repo'; const NAME = 'coordinate'; -moduleFor(`service:${NAME}s`, `Integration | Service | ${NAME}s`, { +moduleFor(`service:repository/${NAME}`, `Integration | Service | ${NAME}`, { // Specify the other units that are required for this test. - needs: [ - 'service:settings', - 'service:store', - `adapter:${NAME}`, - `serializer:${NAME}`, - `model:${NAME}`, - ], + integration: true }); const dc = 'dc-1'; diff --git a/ui-v2/tests/integration/services/dc-test.js b/ui-v2/tests/integration/services/repository/dc-test.js similarity index 79% rename from ui-v2/tests/integration/services/dc-test.js rename to ui-v2/tests/integration/services/repository/dc-test.js index 6a296b7cb0..7333fab6b7 100644 --- a/ui-v2/tests/integration/services/dc-test.js +++ b/ui-v2/tests/integration/services/repository/dc-test.js @@ -2,18 +2,9 @@ import { moduleFor, test } from 'ember-qunit'; import { skip } from 'qunit'; import repo from 'consul-ui/tests/helpers/repo'; const NAME = 'dc'; -moduleFor(`service:${NAME}`, `Integration | Service | ${NAME}s`, { +moduleFor(`service:repository/${NAME}`, `Integration | Service | ${NAME}`, { // Specify the other units that are required for this test. - needs: [ - 'service:settings', - 'service:store', - `adapter:${NAME}`, - `serializer:${NAME}`, - `model:${NAME}`, - // relationships - 'model:service', - 'model:node', - ], + integration: true, }); skip("findBySlug (doesn't interact with the API) but still needs an int test"); test('findAll returns the correct data for list endpoint', function(assert) { diff --git a/ui-v2/tests/integration/services/intentions-test.js b/ui-v2/tests/integration/services/repository/intention-test.js similarity index 96% rename from ui-v2/tests/integration/services/intentions-test.js rename to ui-v2/tests/integration/services/repository/intention-test.js index fa04fa4b40..bedfbb9f2b 100644 --- a/ui-v2/tests/integration/services/intentions-test.js +++ b/ui-v2/tests/integration/services/repository/intention-test.js @@ -1,7 +1,7 @@ import { moduleFor, test } from 'ember-qunit'; import repo from 'consul-ui/tests/helpers/repo'; const NAME = 'intention'; -moduleFor(`service:${NAME}s`, `Integration | Service | ${NAME}s`, { +moduleFor(`service:repository/${NAME}`, `Integration | Service | ${NAME}`, { // Specify the other units that are required for this test. needs: [ 'service:settings', diff --git a/ui-v2/tests/integration/services/kvs-test.js b/ui-v2/tests/integration/services/repository/kv-test.js similarity index 87% rename from ui-v2/tests/integration/services/kvs-test.js rename to ui-v2/tests/integration/services/repository/kv-test.js index 3926fae5c1..a1b48badc4 100644 --- a/ui-v2/tests/integration/services/kvs-test.js +++ b/ui-v2/tests/integration/services/repository/kv-test.js @@ -1,16 +1,9 @@ import { moduleFor, test } from 'ember-qunit'; import repo from 'consul-ui/tests/helpers/repo'; const NAME = 'kv'; -moduleFor(`service:${NAME}`, `Integration | Service | ${NAME}s`, { +moduleFor(`service:repository/${NAME}`, `Integration | Service | ${NAME}`, { // Specify the other units that are required for this test. - needs: [ - 'service:settings', - 'service:store', - `adapter:${NAME}`, - `serializer:${NAME}`, - `model:${NAME}`, - 'service:atob', - ], + integration: true, }); const dc = 'dc-1'; const id = 'key-name'; diff --git a/ui-v2/tests/integration/services/nodes-test.js b/ui-v2/tests/integration/services/repository/node-test.js similarity index 83% rename from ui-v2/tests/integration/services/nodes-test.js rename to ui-v2/tests/integration/services/repository/node-test.js index b438eea4df..8a6b4816da 100644 --- a/ui-v2/tests/integration/services/nodes-test.js +++ b/ui-v2/tests/integration/services/repository/node-test.js @@ -1,19 +1,9 @@ import { moduleFor, test } from 'ember-qunit'; import repo from 'consul-ui/tests/helpers/repo'; const NAME = 'node'; -moduleFor(`service:${NAME}s`, `Integration | Service | ${NAME}s`, { +moduleFor(`service:repository/${NAME}`, `Integration | Service | ${NAME}`, { // Specify the other units that are required for this test. - needs: [ - 'service:settings', - 'service:store', - `adapter:${NAME}`, - `serializer:${NAME}`, - `model:${NAME}`, - 'service:coordinates', - 'adapter:coordinate', - 'serializer:coordinate', - 'model:coordinate', - ], + integration: true, }); const dc = 'dc-1'; diff --git a/ui-v2/tests/integration/services/services-test.js b/ui-v2/tests/integration/services/repository/service-test.js similarity index 91% rename from ui-v2/tests/integration/services/services-test.js rename to ui-v2/tests/integration/services/repository/service-test.js index 7e8b69ccbf..630aa38e4a 100644 --- a/ui-v2/tests/integration/services/services-test.js +++ b/ui-v2/tests/integration/services/repository/service-test.js @@ -1,15 +1,10 @@ import { moduleFor, test } from 'ember-qunit'; import { skip } from 'qunit'; import repo from 'consul-ui/tests/helpers/repo'; -moduleFor('service:services', 'Integration | Service | services', { +const NAME = 'service'; +moduleFor(`service:repository/${NAME}`, `Integration | Service | ${NAME}`, { // Specify the other units that are required for this test. - needs: [ - 'service:store', - 'model:service', - 'adapter:service', - 'serializer:service', - 'service:settings', - ], + integration: true, }); const dc = 'dc-1'; const id = 'token-name'; diff --git a/ui-v2/tests/integration/services/sessions-test.js b/ui-v2/tests/integration/services/repository/session-test.js similarity index 88% rename from ui-v2/tests/integration/services/sessions-test.js rename to ui-v2/tests/integration/services/repository/session-test.js index dadac1df6b..cdc3fcc0a7 100644 --- a/ui-v2/tests/integration/services/sessions-test.js +++ b/ui-v2/tests/integration/services/repository/session-test.js @@ -1,15 +1,9 @@ import { moduleFor, test } from 'ember-qunit'; import repo from 'consul-ui/tests/helpers/repo'; const NAME = 'session'; -moduleFor(`service:${NAME}`, `Integration | Service | ${NAME}s`, { +moduleFor(`service:repository/${NAME}`, `Integration | Service | ${NAME}`, { // Specify the other units that are required for this test. - needs: [ - 'service:settings', - 'service:store', - `adapter:${NAME}`, - `serializer:${NAME}`, - `model:${NAME}`, - ], + integration: true, }); const dc = 'dc-1'; diff --git a/ui-v2/tests/unit/mixins/acl/with-actions-test.js b/ui-v2/tests/unit/mixins/acl/with-actions-test.js index ade74b60f9..7dba82823c 100644 --- a/ui-v2/tests/unit/mixins/acl/with-actions-test.js +++ b/ui-v2/tests/unit/mixins/acl/with-actions-test.js @@ -1,8 +1,8 @@ import { moduleFor } from 'ember-qunit'; import test from 'ember-sinon-qunit/test-support/test'; import { getOwner } from '@ember/application'; -import Route from 'consul-ui/routes/dc/acls/index'; import Service from '@ember/service'; +import Route from 'consul-ui/routes/dc/acls/index'; import Mixin from 'consul-ui/mixins/acl/with-actions'; @@ -14,7 +14,7 @@ moduleFor('mixin:acl/with-actions', 'Unit | Mixin | acl/with actions', { 'service:flashMessages', 'service:logger', 'service:settings', - 'service:acls', + 'service:repository/acl', ], subject: function() { const MixedIn = Route.extend(Mixin); @@ -72,7 +72,7 @@ test('clone clones the token and calls afterDelete correctly', function(assert) ); const expected = { ID: 'id' }; this.register( - 'service:acls', + 'service:repository/acl', Service.extend({ clone: function(actual) { assert.deepEqual(actual, expected); diff --git a/ui-v2/tests/unit/routes/application-test.js b/ui-v2/tests/unit/routes/application-test.js index 386b5f1fc4..1831cd9b83 100644 --- a/ui-v2/tests/unit/routes/application-test.js +++ b/ui-v2/tests/unit/routes/application-test.js @@ -2,7 +2,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:application', 'Unit | Route | application', { // Specify the other units that are required for this test. - needs: ['service:dc'], + needs: ['service:repository/dc'], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc-test.js b/ui-v2/tests/unit/routes/dc-test.js index 16c9f18814..7dc45ae66e 100644 --- a/ui-v2/tests/unit/routes/dc-test.js +++ b/ui-v2/tests/unit/routes/dc-test.js @@ -3,7 +3,7 @@ import test from 'ember-sinon-qunit/test-support/test'; moduleFor('route:dc', 'Unit | Route | dc', { // Specify the other units that are required for this test. - needs: ['service:dc', 'service:settings'], + needs: ['service:repository/dc', 'service:settings'], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc/acls/create-test.js b/ui-v2/tests/unit/routes/dc/acls/create-test.js index 0edf28c51e..1c7009f323 100644 --- a/ui-v2/tests/unit/routes/dc/acls/create-test.js +++ b/ui-v2/tests/unit/routes/dc/acls/create-test.js @@ -3,7 +3,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/acls/create', 'Unit | Route | dc/acls/create', { // Specify the other units that are required for this test. needs: [ - 'service:acls', + 'service:repository/acl', 'service:feedback', 'service:logger', 'service:settings', diff --git a/ui-v2/tests/unit/routes/dc/acls/edit-test.js b/ui-v2/tests/unit/routes/dc/acls/edit-test.js index e503f3ebb5..c58806da05 100644 --- a/ui-v2/tests/unit/routes/dc/acls/edit-test.js +++ b/ui-v2/tests/unit/routes/dc/acls/edit-test.js @@ -3,7 +3,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/acls/edit', 'Unit | Route | dc/acls/edit', { // Specify the other units that are required for this test. needs: [ - 'service:acls', + 'service:repository/acl', 'service:settings', 'service:logger', 'service:feedback', diff --git a/ui-v2/tests/unit/routes/dc/acls/index-test.js b/ui-v2/tests/unit/routes/dc/acls/index-test.js index 07be1d7694..5038879f8f 100644 --- a/ui-v2/tests/unit/routes/dc/acls/index-test.js +++ b/ui-v2/tests/unit/routes/dc/acls/index-test.js @@ -3,7 +3,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/acls/index', 'Unit | Route | dc/acls/index', { // Specify the other units that are required for this test. needs: [ - 'service:acls', + 'service:repository/acl', 'service:feedback', 'service:logger', 'service:settings', diff --git a/ui-v2/tests/unit/routes/dc/intentions/create-test.js b/ui-v2/tests/unit/routes/dc/intentions/create-test.js index 97b24ee224..46a7339aee 100644 --- a/ui-v2/tests/unit/routes/dc/intentions/create-test.js +++ b/ui-v2/tests/unit/routes/dc/intentions/create-test.js @@ -3,8 +3,8 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/intentions/create', 'Unit | Route | dc/intentions/create', { // Specify the other units that are required for this test. needs: [ - 'service:services', - 'service:intentions', + 'service:repository/service', + 'service:repository/intention', 'service:feedback', 'service:logger', 'service:flashMessages', diff --git a/ui-v2/tests/unit/routes/dc/intentions/edit-test.js b/ui-v2/tests/unit/routes/dc/intentions/edit-test.js index 50ce0ca789..97c44e72d6 100644 --- a/ui-v2/tests/unit/routes/dc/intentions/edit-test.js +++ b/ui-v2/tests/unit/routes/dc/intentions/edit-test.js @@ -3,8 +3,8 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/intentions/edit', 'Unit | Route | dc/intentions/edit', { // Specify the other units that are required for this test. needs: [ - 'service:services', - 'service:intentions', + 'service:repository/service', + 'service:repository/intention', 'service:feedback', 'service:logger', 'service:flashMessages', diff --git a/ui-v2/tests/unit/routes/dc/intentions/index-test.js b/ui-v2/tests/unit/routes/dc/intentions/index-test.js index 1d4d6c3e8c..afc181fa38 100644 --- a/ui-v2/tests/unit/routes/dc/intentions/index-test.js +++ b/ui-v2/tests/unit/routes/dc/intentions/index-test.js @@ -2,7 +2,12 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/intentions/index', 'Unit | Route | dc/intentions/index', { // Specify the other units that are required for this test. - needs: ['service:intentions', 'service:feedback', 'service:logger', 'service:flashMessages'], + needs: [ + 'service:repository/intention', + 'service:feedback', + 'service:logger', + 'service:flashMessages', + ], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc/kv/create-test.js b/ui-v2/tests/unit/routes/dc/kv/create-test.js index 93d06f4ab3..df313ef5dd 100644 --- a/ui-v2/tests/unit/routes/dc/kv/create-test.js +++ b/ui-v2/tests/unit/routes/dc/kv/create-test.js @@ -2,7 +2,7 @@ import { moduleFor, skip } from 'ember-qunit'; moduleFor('route:dc/kv/create', 'Unit | Route | dc/kv/create', { // Specify the other units that are required for this test. - needs: ['service:kv', 'service:feedback', 'service:logger'], + needs: ['service:repository/kv', 'service:feedback', 'service:logger'], }); skip('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc/kv/edit-test.js b/ui-v2/tests/unit/routes/dc/kv/edit-test.js index d687faa9bd..024e84d327 100644 --- a/ui-v2/tests/unit/routes/dc/kv/edit-test.js +++ b/ui-v2/tests/unit/routes/dc/kv/edit-test.js @@ -3,8 +3,8 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/kv/edit', 'Unit | Route | dc/kv/edit', { // Specify the other units that are required for this test. needs: [ - 'service:kv', - 'service:session', + 'service:repository/kv', + 'service:repository/session', 'service:feedback', 'service:logger', 'service:flashMessages', diff --git a/ui-v2/tests/unit/routes/dc/kv/index-test.js b/ui-v2/tests/unit/routes/dc/kv/index-test.js index fa035ccb3c..d1719b2ae0 100644 --- a/ui-v2/tests/unit/routes/dc/kv/index-test.js +++ b/ui-v2/tests/unit/routes/dc/kv/index-test.js @@ -2,7 +2,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/kv/index', 'Unit | Route | dc/kv/index', { // Specify the other units that are required for this test. - needs: ['service:kv', 'service:feedback', 'service:logger', 'service:flashMessages'], + needs: ['service:repository/kv', 'service:feedback', 'service:logger', 'service:flashMessages'], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc/kv/root-create-test.js b/ui-v2/tests/unit/routes/dc/kv/root-create-test.js index ca367e1f22..963a04df3f 100644 --- a/ui-v2/tests/unit/routes/dc/kv/root-create-test.js +++ b/ui-v2/tests/unit/routes/dc/kv/root-create-test.js @@ -2,7 +2,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/kv/root-create', 'Unit | Route | dc/kv/root create', { // Specify the other units that are required for this test. - needs: ['service:kv', 'service:feedback', 'service:logger', 'service:flashMessages'], + needs: ['service:repository/kv', 'service:feedback', 'service:logger', 'service:flashMessages'], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc/nodes/index-test.js b/ui-v2/tests/unit/routes/dc/nodes/index-test.js index b41bf938ee..5ee1eaa78c 100644 --- a/ui-v2/tests/unit/routes/dc/nodes/index-test.js +++ b/ui-v2/tests/unit/routes/dc/nodes/index-test.js @@ -2,7 +2,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/nodes/index', 'Unit | Route | dc/nodes/index', { // Specify the other units that are required for this test. - needs: ['service:nodes'] + needs: ['service:repository/node'], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc/nodes/show-test.js b/ui-v2/tests/unit/routes/dc/nodes/show-test.js index fa5b154558..e6f486e6bc 100644 --- a/ui-v2/tests/unit/routes/dc/nodes/show-test.js +++ b/ui-v2/tests/unit/routes/dc/nodes/show-test.js @@ -3,8 +3,8 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/nodes/show', 'Unit | Route | dc/nodes/show', { // Specify the other units that are required for this test. needs: [ - 'service:nodes', - 'service:session', + 'service:repository/node', + 'service:repository/session', 'service:feedback', 'service:logger', 'service:flashMessages', diff --git a/ui-v2/tests/unit/routes/dc/services/index-test.js b/ui-v2/tests/unit/routes/dc/services/index-test.js index 9fe5f2c7af..8b0f91513d 100644 --- a/ui-v2/tests/unit/routes/dc/services/index-test.js +++ b/ui-v2/tests/unit/routes/dc/services/index-test.js @@ -2,7 +2,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/services/index', 'Unit | Route | dc/services/index', { // Specify the other units that are required for this test. - needs: ['service:services'] + needs: ['service:repository/service'], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc/services/show-test.js b/ui-v2/tests/unit/routes/dc/services/show-test.js index cf6d08da95..773bf7326d 100644 --- a/ui-v2/tests/unit/routes/dc/services/show-test.js +++ b/ui-v2/tests/unit/routes/dc/services/show-test.js @@ -2,7 +2,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/services/show', 'Unit | Route | dc/services/show', { // Specify the other units that are required for this test. - needs: ['service:services'], + needs: ['service:repository/service'], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/index-test.js b/ui-v2/tests/unit/routes/index-test.js index c63d14762f..c6574dd70e 100644 --- a/ui-v2/tests/unit/routes/index-test.js +++ b/ui-v2/tests/unit/routes/index-test.js @@ -4,7 +4,7 @@ import test from 'ember-sinon-qunit/test-support/test'; moduleFor('route:index', 'Unit | Route | index', { // Specify the other units that are required for this test. - needs: ['service:dc'], + needs: ['service:repository/dc'], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/settings-test.js b/ui-v2/tests/unit/routes/settings-test.js index 1101d17576..52f71ebcec 100644 --- a/ui-v2/tests/unit/routes/settings-test.js +++ b/ui-v2/tests/unit/routes/settings-test.js @@ -3,7 +3,7 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:settings', 'Unit | Route | settings', { // Specify the other units that are required for this test. needs: [ - 'service:dc', + 'service:repository/dc', 'service:settings', 'service:logger', 'service:feedback', diff --git a/ui-v2/tests/unit/services/nodes-test.js b/ui-v2/tests/unit/services/nodes-test.js deleted file mode 100644 index fa03f80f89..0000000000 --- a/ui-v2/tests/unit/services/nodes-test.js +++ /dev/null @@ -1,12 +0,0 @@ -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('service:nodes', 'Unit | Service | nodes', { - // Specify the other units that are required for this test. - needs: ['service:coordinates'], -}); - -// Replace this with your real tests. -test('it exists', function(assert) { - let service = this.subject(); - assert.ok(service); -}); diff --git a/ui-v2/tests/unit/services/intentions-test.js b/ui-v2/tests/unit/services/repository-test.js similarity index 81% rename from ui-v2/tests/unit/services/intentions-test.js rename to ui-v2/tests/unit/services/repository-test.js index fc2050c9c0..ec5ce314c7 100644 --- a/ui-v2/tests/unit/services/intentions-test.js +++ b/ui-v2/tests/unit/services/repository-test.js @@ -1,6 +1,6 @@ import { moduleFor, test } from 'ember-qunit'; -moduleFor('service:intentions', 'Unit | Service | intentions', { +moduleFor('service:repository', 'Unit | Service | repository', { // Specify the other units that are required for this test. // needs: ['service:foo'] }); diff --git a/ui-v2/tests/unit/services/kv-test.js b/ui-v2/tests/unit/services/repository/acl-test.js similarity index 84% rename from ui-v2/tests/unit/services/kv-test.js rename to ui-v2/tests/unit/services/repository/acl-test.js index aff16d72de..2edab4527b 100644 --- a/ui-v2/tests/unit/services/kv-test.js +++ b/ui-v2/tests/unit/services/repository/acl-test.js @@ -1,6 +1,6 @@ import { moduleFor, test } from 'ember-qunit'; -moduleFor('service:kv', 'Unit | Service | kv', { +moduleFor('service:acl', 'Unit | Service | acl', { // Specify the other units that are required for this test. // needs: ['service:foo'] }); diff --git a/ui-v2/tests/unit/services/acls-test.js b/ui-v2/tests/unit/services/repository/acls-test.js similarity index 81% rename from ui-v2/tests/unit/services/acls-test.js rename to ui-v2/tests/unit/services/repository/acls-test.js index 579d6ebdea..4ee3a64f55 100644 --- a/ui-v2/tests/unit/services/acls-test.js +++ b/ui-v2/tests/unit/services/repository/acls-test.js @@ -1,6 +1,6 @@ import { moduleFor, test } from 'ember-qunit'; -moduleFor('service:acls', 'Unit | Service | acls', { +moduleFor('service:repository/acl', 'Unit | Service | acl', { // Specify the other units that are required for this test. // needs: ['service:foo'] }); diff --git a/ui-v2/tests/unit/services/repository/coordinate-test.js b/ui-v2/tests/unit/services/repository/coordinate-test.js new file mode 100644 index 0000000000..738eb38936 --- /dev/null +++ b/ui-v2/tests/unit/services/repository/coordinate-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('service:repository/coordinate', 'Unit | Service | coordinate', { + // Specify the other units that are required for this test. + // needs: ['service:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let service = this.subject(); + assert.ok(service); +}); diff --git a/ui-v2/tests/unit/services/dc-test.js b/ui-v2/tests/unit/services/repository/dc-test.js similarity index 82% rename from ui-v2/tests/unit/services/dc-test.js rename to ui-v2/tests/unit/services/repository/dc-test.js index 529881ce52..7d0299504a 100644 --- a/ui-v2/tests/unit/services/dc-test.js +++ b/ui-v2/tests/unit/services/repository/dc-test.js @@ -1,6 +1,6 @@ import { moduleFor, test } from 'ember-qunit'; -moduleFor('service:dc', 'Unit | Service | dc', { +moduleFor('service:repository/dc', 'Unit | Service | dc', { // Specify the other units that are required for this test. needs: ['service:settings'], }); diff --git a/ui-v2/tests/unit/services/repository/intention-test.js b/ui-v2/tests/unit/services/repository/intention-test.js new file mode 100644 index 0000000000..934379ad8f --- /dev/null +++ b/ui-v2/tests/unit/services/repository/intention-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('service:repository/intention', 'Unit | Service | intention', { + // Specify the other units that are required for this test. + // needs: ['service:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let service = this.subject(); + assert.ok(service); +}); diff --git a/ui-v2/tests/unit/services/session-test.js b/ui-v2/tests/unit/services/repository/kv-test.js similarity index 82% rename from ui-v2/tests/unit/services/session-test.js rename to ui-v2/tests/unit/services/repository/kv-test.js index a027c05370..ac9994a8bb 100644 --- a/ui-v2/tests/unit/services/session-test.js +++ b/ui-v2/tests/unit/services/repository/kv-test.js @@ -1,6 +1,6 @@ import { moduleFor, test } from 'ember-qunit'; -moduleFor('service:session', 'Unit | Service | session', { +moduleFor('service:repository/kv', 'Unit | Service | kv', { // Specify the other units that are required for this test. // needs: ['service:foo'] }); diff --git a/ui-v2/tests/unit/services/repository/node-test.js b/ui-v2/tests/unit/services/repository/node-test.js new file mode 100644 index 0000000000..cbf02f1c44 --- /dev/null +++ b/ui-v2/tests/unit/services/repository/node-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('service:repository/node', 'Unit | Service | node', { + // Specify the other units that are required for this test. + needs: ['service:repository/coordinate'], +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let service = this.subject(); + assert.ok(service); +}); diff --git a/ui-v2/tests/unit/services/coordinates-test.js b/ui-v2/tests/unit/services/repository/service-test.js similarity index 79% rename from ui-v2/tests/unit/services/coordinates-test.js rename to ui-v2/tests/unit/services/repository/service-test.js index 745267dfb5..40caf2b7d2 100644 --- a/ui-v2/tests/unit/services/coordinates-test.js +++ b/ui-v2/tests/unit/services/repository/service-test.js @@ -1,6 +1,6 @@ import { moduleFor, test } from 'ember-qunit'; -moduleFor('service:coordinates', 'Unit | Service | coordinates', { +moduleFor('service:repository/service', 'Unit | Service | service', { // Specify the other units that are required for this test. // needs: ['service:foo'] }); diff --git a/ui-v2/tests/unit/services/repository/session-test.js b/ui-v2/tests/unit/services/repository/session-test.js new file mode 100644 index 0000000000..0ef9228648 --- /dev/null +++ b/ui-v2/tests/unit/services/repository/session-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('service:repository/session', 'Unit | Service | session', { + // Specify the other units that are required for this test. + // needs: ['service:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let service = this.subject(); + assert.ok(service); +}); diff --git a/ui-v2/tests/unit/services/services-test.js b/ui-v2/tests/unit/services/services-test.js deleted file mode 100644 index 3d8485cc95..0000000000 --- a/ui-v2/tests/unit/services/services-test.js +++ /dev/null @@ -1,12 +0,0 @@ -import { moduleFor, test } from 'ember-qunit'; - -moduleFor('service:services', 'Unit | Service | services', { - // Specify the other units that are required for this test. - // needs: ['service:foo'] -}); - -// Replace this with your real tests. -test('it exists', function(assert) { - let service = this.subject(); - assert.ok(service); -});