Add workound for order-dependent notification_collection_spec.js
This is from Flaburgan: https://github.com/diaspora/diaspora/pull/8305/files I can't find a better way around it. The specs that call `onChangedUnreadStatus` change the environment in ways we can't figure out how to reset cleanly.
This commit is contained in:
parent
09ecaec0b5
commit
94956a2eda
1 changed files with 12 additions and 0 deletions
|
|
@ -14,6 +14,12 @@ describe("app.collections.Notifications", function() {
|
|||
|
||||
it("initializes attributes", function() {
|
||||
var target = new app.collections.Notifications();
|
||||
/* I don't know how backbone is working, but if I don't force reset the old values are kept from previous test */
|
||||
if (target !== undefined) {
|
||||
target.unreadCount = 0;
|
||||
target.unreadCountByType = {};
|
||||
}
|
||||
/* end of force refresh */
|
||||
expect(target.model).toBe(app.models.Notification);
|
||||
/* eslint-disable camelcase */
|
||||
expect(target.url).toBe(Routes.notifications({per_page: 10, page: 1}));
|
||||
|
|
@ -174,6 +180,12 @@ describe("app.collections.Notifications", function() {
|
|||
describe("parse", function() {
|
||||
beforeEach(function() {
|
||||
this.target = new app.collections.Notifications();
|
||||
/* I don't know how backbone is working, but if I don't force reset the old values are kept from previous test */
|
||||
if (this.target !== undefined) {
|
||||
this.target.unreadCount = 0;
|
||||
this.target.unreadCountByType = {};
|
||||
}
|
||||
/* end of force refresh */
|
||||
});
|
||||
|
||||
it("sets the unreadCount and unreadCountByType attributes", function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue