github.com/jancarloviray/community@v0.41.1-0.20170124221257-33a66c87cf2f/app/tests/helpers/stub-user-notification.js (about) 1 // Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved. 2 // 3 // This software (Documize Community Edition) is licensed under 4 // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html 5 // 6 // You can operate outside the AGPL restrictions by purchasing 7 // Documize Enterprise Edition and obtaining a commercial license 8 // by contacting <sales@documize.com>. 9 // 10 // https://documize.com 11 12 import Ember from 'ember'; 13 14 const userNotification = Ember.Component.extend({ 15 notifications: [], 16 17 didInsertElement() { 18 // this.eventBus.subscribe('notifyUser', this, 'notifyHandler'); 19 }, 20 21 willDestroyElement() { 22 // this.eventBus.unsubscribe('notifyUser'); 23 }, 24 25 showNotification(msg) { 26 return msg; 27 } 28 }); 29 30 export default Ember.Test.registerAsyncHelper('stubUserNotification', function (app, test, attrs = {}) { 31 test.register('component:userNotification', userNotification.extend(attrs)); 32 });