fixes some unit tests

This commit is contained in:
Shannon
2014-01-17 13:18:49 +11:00
parent ae05bfd350
commit 1621d01992
2 changed files with 7 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ describe('edit media controller tests', function () {
});
it('it should have a tabs collection', function () {
expect(scope.content.tabs.length).toBe(5);
expect(scope.content.tabs.length).toBe(1);
});
it('it should have a properties collection on each tab', function () {

View File

@@ -60,7 +60,7 @@ describe('Content picker controller tests', function () {
it("Removing an item should update renderModel, ids and model.value", function(){
scope.remove(1);
scope.$apply();
expect(scope.renderModel.length).toBe(2);
expect(scope.ids.length).toBe(2);
expect(scope.model.value).toBe("1233,23121");
@@ -69,7 +69,7 @@ describe('Content picker controller tests', function () {
it("Adding an item should update renderModel, ids and model.value", function(){
scope.add({name: "meh", id: 666, icon: "woop"});
scope.$apply();
expect(scope.renderModel.length).toBe(4);
expect(scope.ids.length).toBe(4);
expect(scope.model.value).toBe("1233,1231,23121,666");
@@ -77,12 +77,14 @@ describe('Content picker controller tests', function () {
it("Adding a dublicate item should note update renderModel, ids and model.value", function(){
scope.add({name: "meh", id: 666, icon: "woop"});
scope.add({ name: "meh", id: 666, icon: "woop" });
scope.$apply();
expect(scope.renderModel.length).toBe(4);
expect(scope.ids.length).toBe(4);
expect(scope.model.value).toBe("1233,1231,23121,666");
scope.add({name: "meh 2", id: 666, icon: "woop 2"});
scope.add({ name: "meh 2", id: 666, icon: "woop 2" });
scope.$apply();
expect(scope.renderModel.length).toBe(4);
expect(scope.ids.length).toBe(4);
expect(scope.model.value).toBe("1233,1231,23121,666");