1
0
Fork 0
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:
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", "stubAudit",
"pauseTest", "pauseTest",
"userLogin", "userLogin",
"skip" "skip",
"waitToAppear"
], ],
"node": false, "node": false,
"browser": false, "browser": false,

View file

@ -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);

View file

@ -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;

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