open-consul/ui-v2/tests/test-helper.js
John Cowen e4e209b748
ui: Implements a testable clipboard {{copy-button}} (#5967)
1. Remove ember-cli-clipboard dependency
2. Provide a new copy-button component implementing the same
interface as ^ but make the clipboard functionality injectable
3. Provide 2 implementations of a Clipboard. One using clipboard.js (as
previously) and an additional local storage 'clipboard'.
4. add a BDD step to assert whats in the clipboard (the fake one)

Main reason here is that `document.exec` must be called by a user
interaction
2019-06-21 11:42:40 +01:00

14 lines
463 B
JavaScript

import Application from '../app';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import './helpers/flash-message';
import loadEmberExam from 'ember-exam/test-support/load';
loadEmberExam();
const application = Application.create(config.APP);
application.inject('component:copy-button', 'clipboard', 'service:clipboard/local-storage');
setApplication(application);
start();