diff --git a/ui-v2/app/components/confirmation-dialog.js b/ui-v2/app/components/confirmation-dialog.js index d52b4cfaf47e..b53dcd68ed47 100644 --- a/ui-v2/app/components/confirmation-dialog.js +++ b/ui-v2/app/components/confirmation-dialog.js @@ -3,7 +3,6 @@ import Component from '@ember/component'; import SlotsMixin from 'block-slots'; import { set } from '@ember/object'; -import { inject as service } from '@ember/service'; const cancel = function() { set(this, 'confirming', false); @@ -15,25 +14,10 @@ const confirm = function() { const [action, ...args] = arguments; set(this, 'actionName', action); set(this, 'arguments', args); - if (this._isRegistered('dialog')) { - set(this, 'confirming', true); - } else { - this._confirm - .execute(this.message) - .then(confirmed => { - if (confirmed) { - this.execute(); - } - }) - .catch(function() { - return this.error.execute(...arguments); - }); - } + set(this, 'confirming', true); }; export default Component.extend(SlotsMixin, { classNameBindings: ['confirming'], - _confirm: service('confirm'), - error: service('error'), classNames: ['with-confirmation'], message: 'Are you sure?', confirming: false, diff --git a/ui-v2/tests/unit/services/confirm-test.js b/ui-v2/tests/unit/services/confirm-test.js deleted file mode 100644 index c573fc2ed43d..000000000000 --- a/ui-v2/tests/unit/services/confirm-test.js +++ /dev/null @@ -1,12 +0,0 @@ -import { module, test } from 'qunit'; -import { setupTest } from 'ember-qunit'; - -module('Unit | Service | confirm', function(hooks) { - setupTest(hooks); - - // Replace this with your real tests. - test('it exists', function(assert) { - let service = this.owner.lookup('service:confirm'); - assert.ok(service); - }); -}); diff --git a/ui-v2/tests/unit/services/error-test.js b/ui-v2/tests/unit/services/error-test.js deleted file mode 100644 index 482375423589..000000000000 --- a/ui-v2/tests/unit/services/error-test.js +++ /dev/null @@ -1,12 +0,0 @@ -import { module, test } from 'qunit'; -import { setupTest } from 'ember-qunit'; - -module('Unit | Service | error', function(hooks) { - setupTest(hooks); - - // Replace this with your real tests. - test('it exists', function(assert) { - let service = this.owner.lookup('service:error'); - assert.ok(service); - }); -}); diff --git a/ui-v2/tests/unit/utils/confirm-test.js b/ui-v2/tests/unit/utils/confirm-test.js deleted file mode 100644 index 48cd0d455a3b..000000000000 --- a/ui-v2/tests/unit/utils/confirm-test.js +++ /dev/null @@ -1,17 +0,0 @@ -import { module } from 'qunit'; -import test from 'ember-sinon-qunit/test-support/test'; -import confirm from 'consul-ui/utils/confirm'; - -module('Unit | Utils | confirm', function() { - test('it resolves the result of the confirmation', function(assert) { - const expected = 'message'; - // split this off into separate testing - const confirmation = function(actual) { - assert.equal(actual, expected); - return true; - }; - return confirm(expected, confirmation).then(function(res) { - assert.ok(res); - }); - }); -}); diff --git a/ui-v2/tests/unit/utils/makeAttrable-test.js b/ui-v2/tests/unit/utils/makeAttrable-test.js deleted file mode 100644 index 2bd426fcd95a..000000000000 --- a/ui-v2/tests/unit/utils/makeAttrable-test.js +++ /dev/null @@ -1,14 +0,0 @@ -import { module } from 'qunit'; -import test from 'ember-sinon-qunit/test-support/test'; -import makeAttrable from 'consul-ui/utils/makeAttrable'; - -module('Unit | Utils | makeAttrable', function() { - test('it adds a `attr` method, which returns the value of the property', function(assert) { - const obj = { - prop: true, - }; - const actual = makeAttrable(obj); - assert.equal(typeof actual.attr, 'function'); - assert.ok(actual.attr('prop')); - }); -});