1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-07 22:45:24 +02:00

Stub user notifications component

This commit is contained in:
zinyando 2016-05-30 20:22:09 +02:00
parent ec605d8917
commit b0ce9e74f8
4 changed files with 27 additions and 1 deletions

View file

@ -27,7 +27,8 @@
"stubAudit",
"pauseTest",
"userLogin",
"skip"
"skip",
"waitToAppear"
],
"node": false,
"browser": false,

View file

@ -8,6 +8,7 @@ export default function(name, options = {}) {
this.application = startApp();
stubAudit(this);
stubSession(this);
stubUserNotification(this);
if (options.beforeEach) {
options.beforeEach.apply(this, arguments);

View file

@ -6,6 +6,7 @@ import './stub-audit';
import './user-login';
import './allow-anonymous-access';
import './wait-to-appear';
import './stub-user-notification';
export default function startApp(attrs) {
let application;

View 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));
});