mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Merge "tests: Remove overlayManager from NotificationBadge params"
This commit is contained in:
commit
6961fa957c
|
@ -83,7 +83,6 @@
|
|||
"localBasePath": "",
|
||||
"remoteExtPath": "Echo",
|
||||
"dependencies": [
|
||||
"mobile.startup",
|
||||
"ext.echo.dm",
|
||||
"ext.echo.mobile"
|
||||
],
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
( function ( M ) {
|
||||
var OverlayManager = M.require( 'mobile.startup' ).OverlayManager,
|
||||
NotificationBadge = require( 'ext.echo.mobile' ).NotificationBadge;
|
||||
( function () {
|
||||
var NotificationBadge = require( 'ext.echo.mobile' ).NotificationBadge;
|
||||
|
||||
QUnit.module( 'ext.echo.mobile - NotificationBadge', {
|
||||
beforeEach: function () {
|
||||
this.OverlayManager = OverlayManager.getSingleton();
|
||||
}
|
||||
} );
|
||||
QUnit.module( 'ext.echo.mobile - NotificationBadge', {} );
|
||||
|
||||
QUnit.test( '#setCount', function ( assert ) {
|
||||
var initialClassExpectationsMet,
|
||||
badge = new NotificationBadge( {
|
||||
overlayManager: this.OverlayManager,
|
||||
hasNotifications: true,
|
||||
hasUnseenNotifications: true,
|
||||
notificationCountRaw: 5
|
||||
|
@ -37,7 +31,6 @@
|
|||
.withArgs( 'echo-badge-count', '۲' ).returns( { text: function () { return '۲'; } } );
|
||||
|
||||
badge = new NotificationBadge( {
|
||||
overlayManager: this.OverlayManager,
|
||||
el: $( '<div><a title="n" href="/" class="notification-unseen"><div class="circle" ><span data-notification-count="2">۲</span></div></a></div>' )
|
||||
} );
|
||||
assert.strictEqual( badge.options.notificationCountRaw, 2,
|
||||
|
@ -52,7 +45,6 @@
|
|||
QUnit.test( '#render [hasUnseenNotifications]', function ( assert ) {
|
||||
var badge = new NotificationBadge( {
|
||||
notificationCountRaw: 0,
|
||||
overlayManager: this.OverlayManager,
|
||||
hasNotifications: false,
|
||||
hasUnseenNotifications: false
|
||||
} );
|
||||
|
@ -62,7 +54,6 @@
|
|||
QUnit.test( '#markAsSeen', function ( assert ) {
|
||||
var badge = new NotificationBadge( {
|
||||
notificationCountRaw: 2,
|
||||
overlayManager: this.OverlayManager,
|
||||
hasNotifications: true,
|
||||
hasUnseenNotifications: true
|
||||
} );
|
||||
|
@ -73,4 +64,4 @@
|
|||
assert.strictEqual( badge.$el.find( '.notification-unseen' ).length, 0,
|
||||
'Unseen class disappears after markAsSeen called.' );
|
||||
} );
|
||||
}( mw.mobileFrontend ) );
|
||||
}() );
|
||||
|
|
Loading…
Reference in a new issue