From 400f0d26ce120902f4bc957f37e2049a5efe7724 Mon Sep 17 00:00:00 2001 From: zinyando Date: Tue, 19 Jul 2016 15:44:57 +0200 Subject: [PATCH] Add tether service --- app/app/services/tether.js | 22 ++++++++++++++++++++++ app/tests/unit/services/tether-test.js | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 app/app/services/tether.js create mode 100644 app/tests/unit/services/tether-test.js diff --git a/app/app/services/tether.js b/app/app/services/tether.js new file mode 100644 index 00000000..38307d0e --- /dev/null +++ b/app/app/services/tether.js @@ -0,0 +1,22 @@ +import Ember from 'ember'; + +/** + * This is a work around problems that tether introduces into testing. + * TODO: remove this code and refactor in favour of ember-tether + */ +export default Ember.Service.extend({ + createDrop() { + if (Ember.testing) { + return; + } + + return new Drop(...arguments); + }, + createTooltip() { + if (Ember.testing) { + return; + } + + return new Tooltip(...arguments); + } +}); diff --git a/app/tests/unit/services/tether-test.js b/app/tests/unit/services/tether-test.js new file mode 100644 index 00000000..dc2970d5 --- /dev/null +++ b/app/tests/unit/services/tether-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('service:tether', 'Unit | Service | tether', { + // 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); +});