summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/tags
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-20 12:17:18 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-20 12:32:06 +0200
commit495bc391e140cc2bb462c81fa90410a0fe8f6a4c (patch)
tree5c141e2fcaefd508acf407267bb23807d46710a9 /web-ui/test/spec/tags
parentb74a39f27c292cc95345b7ab266bb3db2f812a66 (diff)
massive update of bower and npm libs - includes flight, jasmine and a bunch of
stuff. If things get weird when developing, remove you bower_components and your node_modules and install it again
Diffstat (limited to 'web-ui/test/spec/tags')
-rw-r--r--web-ui/test/spec/tags/data/tags.spec.js12
-rw-r--r--web-ui/test/spec/tags/ui/tag.spec.js12
-rw-r--r--web-ui/test/spec/tags/ui/tag_list.spec.js4
-rw-r--r--web-ui/test/spec/tags/ui/tag_shortcut.spec.js4
4 files changed, 16 insertions, 16 deletions
diff --git a/web-ui/test/spec/tags/data/tags.spec.js b/web-ui/test/spec/tags/data/tags.spec.js
index 41821366..e42a7752 100644
--- a/web-ui/test/spec/tags/data/tags.spec.js
+++ b/web-ui/test/spec/tags/data/tags.spec.js
@@ -4,20 +4,20 @@ describeComponent('tags/data/tags', function () {
'use strict';
beforeEach(function () {
- setupComponent();
+ this.setupComponent();
});
it('asks the server for tags when receiving the tags:want event', function() {
- spyOn($, 'ajax').andReturn({done: function() {}});
+ spyOn($, 'ajax').and.returnValue({done: function() {}});
this.component.trigger(Pixelated.events.tags.want);
- expect($.ajax.mostRecentCall.args[0]).toEqual('/tags');
+ expect($.ajax.calls.mostRecent().args[0]).toEqual('/tags');
});
it('triggers an event on the initial sender after receiving tags', function() {
var f;
- spyOn($, 'ajax').andReturn({done: function(d) { f = d; }});
+ spyOn($, 'ajax').and.returnValue({done: function(d) { f = d; }});
var me = {};
var eventSpy = spyOnEvent(me, Pixelated.events.tags.received);
@@ -29,13 +29,13 @@ describeComponent('tags/data/tags', function () {
it('triggers an event containing the returned tags', function() {
var f;
- spyOn($, 'ajax').andReturn({done: function(d) { f = d; }});
+ spyOn($, 'ajax').and.returnValue({done: function(d) { f = d; }});
var me = {};
var eventSpy = spyOnEvent(me, Pixelated.events.tags.received);
this.component.trigger(Pixelated.events.tags.want, { caller: me });
var tags = ['foo', 'bar', 'quux/bar'];
f(tags);
tags.push(this.component.all);
- expect(eventSpy.mostRecentCall.data).toEqual({tags: tags});
+ expect(eventSpy.mostRecentCall.data).toEqual(jasmine.objectContaining({tags: tags}));
});
});
diff --git a/web-ui/test/spec/tags/ui/tag.spec.js b/web-ui/test/spec/tags/ui/tag.spec.js
index 48f761da..1f76ebe3 100644
--- a/web-ui/test/spec/tags/ui/tag.spec.js
+++ b/web-ui/test/spec/tags/ui/tag.spec.js
@@ -6,7 +6,7 @@ describeComponent('tags/ui/tag', function () {
describe('inbox tag', function () {
beforeEach(function () {
- setupComponent('<li></li>', {
+ this.setupComponent('<li></li>', {
tag: {
name: 'inbox',
ident: '1',
@@ -48,7 +48,7 @@ describeComponent('tags/ui/tag', function () {
describe('increasing count read when email is read', function () {
it('doesnt update if mail.tags or mail.mailbox dont match the tag name', function () {
- setupComponent('<li></li>', {
+ this.setupComponent('<li></li>', {
tag: { name: 'sometag', ident: '1', counts: { total: 100, read: 0 } }
});
@@ -65,7 +65,7 @@ describeComponent('tags/ui/tag', function () {
});
it('looks at the mail tags for non default tags', function () {
- setupComponent('<li></li>', {
+ this.setupComponent('<li></li>', {
tag: { name: 'tag', ident: '1', counts: { total: 100, read: 0 } }
});
@@ -101,7 +101,7 @@ describeComponent('tags/ui/tag', function () {
describe('drafts tag', function () {
var containerFordrafts;
beforeEach(function () {
- setupComponent('<li></li>', {
+ this.setupComponent('<li></li>', {
tag: {
name: 'drafts',
ident: '42',
@@ -122,7 +122,7 @@ describeComponent('tags/ui/tag', function () {
describe('all tag', function () {
beforeEach(function () {
- setupComponent('<li></li>', {
+ this.setupComponent('<li></li>', {
tag: {
name: 'all',
ident: '45',
@@ -156,7 +156,7 @@ describeComponent('tags/ui/tag', function () {
_.each(['sent', 'trash'], function (tag_name) {
describe(tag_name + ' tag', function () {
beforeEach(function () {
- setupComponent('<li></li>', {
+ this.setupComponent('<li></li>', {
tag: {
name: tag_name,
ident: '42',
diff --git a/web-ui/test/spec/tags/ui/tag_list.spec.js b/web-ui/test/spec/tags/ui/tag_list.spec.js
index c79bed53..72667b40 100644
--- a/web-ui/test/spec/tags/ui/tag_list.spec.js
+++ b/web-ui/test/spec/tags/ui/tag_list.spec.js
@@ -14,7 +14,7 @@ describeComponent('tags/ui/tag_list', function () {
describe('post initialization', function () {
beforeEach(function () {
- setupComponent();
+ this.setupComponent();
tagsShortcutsContainer = $('<ul>', { id: 'tags-shortcuts' });
$('body').append(tagsShortcutsContainer);
});
@@ -74,7 +74,7 @@ describeComponent('tags/ui/tag_list', function () {
$(document).trigger(Pixelated.events.ui.tagList.load, {tags: [] });
- expect(tagsLoadedEvent).toHaveBeenTriggeredOnAndWith(document, { tag: undefined });
+ expect(tagsLoadedEvent).toHaveBeenTriggeredOnAndWith(document, jasmine.objectContaining({ tag: undefined }));
});
it('should save the current tag when a tag is selected', function () {
diff --git a/web-ui/test/spec/tags/ui/tag_shortcut.spec.js b/web-ui/test/spec/tags/ui/tag_shortcut.spec.js
index 9164507a..7f015319 100644
--- a/web-ui/test/spec/tags/ui/tag_shortcut.spec.js
+++ b/web-ui/test/spec/tags/ui/tag_shortcut.spec.js
@@ -46,8 +46,8 @@ describeComponent('tags/ui/tag_shortcut', function () {
var shortcutAddedAfterEmptyingParent = TagShortcut.appendedTo(parent, { linkTo: { name: 'inbox', counts: { total: 15 }}, trigger: component });
// by now shorcut is not in the DOM anymore but shortcutAddedAfterEmptyingParent is
- spyOn(shortcut, 'teardown').andCallThrough();
- spyOn(shortcutAddedAfterEmptyingParent, 'teardown').andCallThrough();
+ spyOn(shortcut, 'teardown').and.callThrough();
+ spyOn(shortcutAddedAfterEmptyingParent, 'teardown').and.callThrough();
$(document).trigger(Pixelated.events.tags.shortcuts.teardown);