mirror of
https://github.com/documize/community.git
synced 2025-08-08 15:05:28 +02:00
Stub user notifications component
This commit is contained in:
parent
ec605d8917
commit
b0ce9e74f8
4 changed files with 27 additions and 1 deletions
|
@ -27,7 +27,8 @@
|
||||||
"stubAudit",
|
"stubAudit",
|
||||||
"pauseTest",
|
"pauseTest",
|
||||||
"userLogin",
|
"userLogin",
|
||||||
"skip"
|
"skip",
|
||||||
|
"waitToAppear"
|
||||||
],
|
],
|
||||||
"node": false,
|
"node": false,
|
||||||
"browser": false,
|
"browser": false,
|
||||||
|
|
|
@ -8,6 +8,7 @@ export default function(name, options = {}) {
|
||||||
this.application = startApp();
|
this.application = startApp();
|
||||||
stubAudit(this);
|
stubAudit(this);
|
||||||
stubSession(this);
|
stubSession(this);
|
||||||
|
stubUserNotification(this);
|
||||||
|
|
||||||
if (options.beforeEach) {
|
if (options.beforeEach) {
|
||||||
options.beforeEach.apply(this, arguments);
|
options.beforeEach.apply(this, arguments);
|
||||||
|
|
|
@ -6,6 +6,7 @@ import './stub-audit';
|
||||||
import './user-login';
|
import './user-login';
|
||||||
import './allow-anonymous-access';
|
import './allow-anonymous-access';
|
||||||
import './wait-to-appear';
|
import './wait-to-appear';
|
||||||
|
import './stub-user-notification';
|
||||||
|
|
||||||
export default function startApp(attrs) {
|
export default function startApp(attrs) {
|
||||||
let application;
|
let application;
|
||||||
|
|
23
app/tests/helpers/stub-user-notification.js
Normal file
23
app/tests/helpers/stub-user-notification.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import Ember from 'ember';
|
||||||
|
import miscUtil from 'documize/utils/misc';
|
||||||
|
|
||||||
|
const userNotification = Ember.Component.extend({
|
||||||
|
notifications: [],
|
||||||
|
|
||||||
|
didInsertElement() {
|
||||||
|
// this.eventBus.subscribe('notifyUser', this, 'showNotification');
|
||||||
|
},
|
||||||
|
|
||||||
|
willDestroyElement() {
|
||||||
|
// this.eventBus.unsubscribe('notifyUser');
|
||||||
|
},
|
||||||
|
|
||||||
|
showNotification(msg) {
|
||||||
|
// console.log(msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
export default Ember.Test.registerAsyncHelper('stubUserNotification', function(app, test, attrs={}) {
|
||||||
|
test.register('component:userNotification', userNotification.extend(attrs));
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue