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:
parent
ec605d8917
commit
b0ce9e74f8
4 changed files with 27 additions and 1 deletions
|
@ -27,7 +27,8 @@
|
|||
"stubAudit",
|
||||
"pauseTest",
|
||||
"userLogin",
|
||||
"skip"
|
||||
"skip",
|
||||
"waitToAppear"
|
||||
],
|
||||
"node": false,
|
||||
"browser": false,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
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