forked from BuildFire/youtubePlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated test cases for design section
- Loading branch information
1 parent
678423d
commit 50ec835
Showing
4 changed files
with
121 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,45 @@ | ||
describe('Unit: youtubePlugin design app', function () { | ||
describe('Unit : youtubePlugin design app.js', function () { | ||
describe('Unit: app routes', function () { | ||
beforeEach(module('youtubePluginDesign')); | ||
var location, route, rootScope; | ||
beforeEach(inject( | ||
function( _$location_, _$route_, _$rootScope_ ) { | ||
location = _$location_; | ||
route = _$route_; | ||
rootScope = _$rootScope_; | ||
beforeEach(inject(function (_$location_, _$route_, _$rootScope_) { | ||
location = _$location_; | ||
route = _$route_; | ||
rootScope = _$rootScope_; | ||
})); | ||
describe('Home route', function () { | ||
beforeEach(inject( | ||
function ($httpBackend) { | ||
$httpBackend.expectGET('templates/home.html') | ||
.respond(200); | ||
$httpBackend.expectGET('/') | ||
.respond(200); | ||
})); | ||
|
||
describe('Home route', function() { | ||
beforeEach(inject( | ||
function($httpBackend) { | ||
$httpBackend.expectGET('templates/home.html') | ||
.respond(200); | ||
$httpBackend.expectGET('/') | ||
.respond(200); | ||
})); | ||
it('should load the home page on successful load of location path /', function () { | ||
location.path('/'); | ||
rootScope.$digest(); | ||
expect(route.current.controller).toBe('DesignHomeCtrl') | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Unit: getImageUrl filter', function () { | ||
beforeEach(module('youtubePluginDesign')); | ||
var filter; | ||
beforeEach(inject(function (_$filter_) { | ||
filter = _$filter_; | ||
})); | ||
|
||
it('should load the home page on successful load of location path /', function() { | ||
location.path('/'); | ||
rootScope.$digest(); | ||
expect(route.current.controller).toBe('DesignHomeCtrl') | ||
}); | ||
it('it should returns resized image url', function () { | ||
var reSizedImage; | ||
reSizedImage = filter('getImageUrl')('https://www.facebook.com/photo.php?fbid=1008284442533844&set=a.359021657460129.98766.100000568920267&type=1&theater', 88, 124, 'resize'); | ||
expect(reSizedImage).toEqual('http://s7obnu.cloudimage.io/s/resizenp/88x124/https://www.facebook.com/photo.php?fbid=1008284442533844&set=a.359021657460129.98766.100000568920267&type=1&theater'); | ||
}); | ||
it('it should pass if "getImageUrl" filter returns cropped image url', function () { | ||
var croppedImage; | ||
croppedImage = filter('getImageUrl')('https://www.facebook.com/photo.php?fbid=1008284442533844&set=a.359021657460129.98766.100000568920267&type=1&theater', 88, 124, 'crop'); | ||
expect(croppedImage).toEqual('http://s7obnu.cloudimage.io/s/crop/88x124/https://www.facebook.com/photo.php?fbid=1008284442533844&set=a.359021657460129.98766.100000568920267&type=1&theater'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,94 @@ | ||
describe('Unit : youtubePlugin Design Enums', function () { | ||
var TAG_NAMES, STATUS_CODE, STATUS_MESSAGES, CONTENT_TYPE; | ||
beforeEach(module('youtubePluginDesign')); | ||
var TAG_NAMES, STATUS_CODE, STATUS_MESSAGES, CONTENT_TYPE,LAYOUTS; | ||
beforeEach(module('youtubePluginDesign')); | ||
|
||
beforeEach(inject(function (_TAG_NAMES_, _STATUS_CODE_, _STATUS_MESSAGES_, _CONTENT_TYPE_) { | ||
TAG_NAMES = _TAG_NAMES_; | ||
STATUS_CODE = _STATUS_CODE_; | ||
STATUS_MESSAGES = _STATUS_MESSAGES_; | ||
CONTENT_TYPE = _CONTENT_TYPE_; | ||
})); | ||
beforeEach(inject(function (_TAG_NAMES_, _STATUS_CODE_, _STATUS_MESSAGES_, _CONTENT_TYPE_,_LAYOUTS_) { | ||
TAG_NAMES = _TAG_NAMES_; | ||
STATUS_CODE = _STATUS_CODE_; | ||
STATUS_MESSAGES = _STATUS_MESSAGES_; | ||
CONTENT_TYPE = _CONTENT_TYPE_; | ||
LAYOUTS = _LAYOUTS_; | ||
})); | ||
|
||
describe('Enum : TAG_NAMES', function () { | ||
it('TAG_NAMES should exist and be an object', function () { | ||
expect(typeof TAG_NAMES).toEqual('object'); | ||
}); | ||
it('TAG_NAMES.YOUTUBE_INFO should exist and equals to "GetInfo"', function () { | ||
expect(TAG_NAMES.YOUTUBE_INFO).toEqual('YouTubeInfo'); | ||
}); | ||
describe('Enum : TAG_NAMES', function () { | ||
it('TAG_NAMES should exist and be an object', function () { | ||
expect(typeof TAG_NAMES).toEqual('object'); | ||
}); | ||
it('TAG_NAMES.YOUTUBE_INFO should exist and equals to "GetInfo"', function () { | ||
expect(TAG_NAMES.YOUTUBE_INFO).toEqual('YouTubeInfo'); | ||
}); | ||
}); | ||
|
||
describe('Enum : STATUS_CODE', function () { | ||
it('STATUS_CODE should exist and be an object', function () { | ||
expect(typeof STATUS_CODE).toEqual('object'); | ||
}); | ||
it('STATUS_CODE.INSERTED should exist and equals to "inserted"', function () { | ||
expect(STATUS_CODE.INSERTED).toEqual('inserted'); | ||
}); | ||
it('STATUS_CODE.UPDATED should exist and equals to "updated"', function () { | ||
expect(STATUS_CODE.UPDATED).toEqual('updated'); | ||
}); | ||
it('STATUS_CODE.NOT_FOUND should exist and equals to "NOTFOUND"', function () { | ||
expect(STATUS_CODE.NOT_FOUND).toEqual('NOTFOUND'); | ||
}); | ||
it('STATUS_CODE.UNDEFINED_DATA should exist and equals to "UNDEFINED_DATA"', function () { | ||
expect(STATUS_CODE.UNDEFINED_DATA).toEqual('UNDEFINED_DATA'); | ||
}); | ||
it('STATUS_CODE.UNDEFINED_OPTIONS should exist and equals to "UNDEFINED_OPTIONS"', function () { | ||
expect(STATUS_CODE.UNDEFINED_OPTIONS).toEqual('UNDEFINED_OPTIONS'); | ||
}); | ||
it('STATUS_CODE.NOT_FOUND should exist and equals to "UNDEFINED_ID"', function () { | ||
expect(STATUS_CODE.UNDEFINED_ID).toEqual('UNDEFINED_ID'); | ||
}); | ||
}); | ||
|
||
describe('Enum : STATUS_CODE', function () { | ||
it('STATUS_CODE should exist and be an object', function () { | ||
expect(typeof STATUS_CODE).toEqual('object'); | ||
}); | ||
it('STATUS_CODE.INSERTED should exist and equals to "inserted"', function () { | ||
expect(STATUS_CODE.INSERTED).toEqual('inserted'); | ||
}); | ||
it('STATUS_CODE.UPDATED should exist and equals to "updated"', function () { | ||
expect(STATUS_CODE.UPDATED).toEqual('updated'); | ||
}); | ||
it('STATUS_CODE.NOT_FOUND should exist and equals to "NOTFOUND"', function () { | ||
expect(STATUS_CODE.NOT_FOUND).toEqual('NOTFOUND'); | ||
}); | ||
it('STATUS_CODE.UNDEFINED_DATA should exist and equals to "UNDEFINED_DATA"', function () { | ||
expect(STATUS_CODE.UNDEFINED_DATA).toEqual('UNDEFINED_DATA'); | ||
}); | ||
it('STATUS_CODE.UNDEFINED_OPTIONS should exist and equals to "UNDEFINED_OPTIONS"', function () { | ||
expect(STATUS_CODE.UNDEFINED_OPTIONS).toEqual('UNDEFINED_OPTIONS'); | ||
}); | ||
it('STATUS_CODE.NOT_FOUND should exist and equals to "UNDEFINED_ID"', function () { | ||
expect(STATUS_CODE.UNDEFINED_ID).toEqual('UNDEFINED_ID'); | ||
}); | ||
describe('Enum : STATUS_MESSAGES', function () { | ||
it('STATUS_MESSAGES should exist and be an object', function () { | ||
expect(typeof STATUS_MESSAGES).toEqual('object'); | ||
}); | ||
it('STATUS_MESSAGES.UNDEFINED_DATA should exist and equals to "Undefined data provided"', function () { | ||
expect(STATUS_MESSAGES.UNDEFINED_DATA).toEqual('Undefined data provided'); | ||
}); | ||
it('STATUS_MESSAGES.UNDEFINED_OPTIONS should exist and equals to "Undefined options provided"', function () { | ||
expect(STATUS_MESSAGES.UNDEFINED_OPTIONS).toEqual('Undefined options provided'); | ||
}); | ||
it('STATUS_MESSAGES.NOT_FOUND should exist and equals to "Undefined id provided"', function () { | ||
expect(STATUS_MESSAGES.UNDEFINED_ID).toEqual('Undefined id provided'); | ||
}); | ||
}); | ||
|
||
describe('Enum : STATUS_MESSAGES', function () { | ||
it('STATUS_MESSAGES should exist and be an object', function () { | ||
expect(typeof STATUS_MESSAGES).toEqual('object'); | ||
}); | ||
it('STATUS_MESSAGES.UNDEFINED_DATA should exist and equals to "Undefined data provided"', function () { | ||
expect(STATUS_MESSAGES.UNDEFINED_DATA).toEqual('Undefined data provided'); | ||
}); | ||
it('STATUS_MESSAGES.UNDEFINED_OPTIONS should exist and equals to "Undefined options provided"', function () { | ||
expect(STATUS_MESSAGES.UNDEFINED_OPTIONS).toEqual('Undefined options provided'); | ||
}); | ||
it('STATUS_MESSAGES.NOT_FOUND should exist and equals to "Undefined id provided"', function () { | ||
expect(STATUS_MESSAGES.UNDEFINED_ID).toEqual('Undefined id provided'); | ||
}); | ||
describe('Enum : CONTENT_TYPE', function () { | ||
it('CONTENT_TYPE should exist and be an object', function () { | ||
expect(typeof CONTENT_TYPE).toEqual('object'); | ||
}); | ||
it('CONTENT_TYPE.CHANNEL_FEED should exist and equals to "Channel Feed"', function () { | ||
expect(CONTENT_TYPE.CHANNEL_FEED).toEqual('Channel Feed'); | ||
}); | ||
it('CONTENT_TYPE.SINGLE_VIDEO should exist and equals to "Single Video"', function () { | ||
expect(CONTENT_TYPE.SINGLE_VIDEO).toEqual('Single Video'); | ||
}); | ||
}); | ||
|
||
|
||
describe('Enum : CONTENT_TYPE', function () { | ||
it('CONTENT_TYPE should exist and be an object', function () { | ||
expect(typeof CONTENT_TYPE).toEqual('object'); | ||
}); | ||
it('CONTENT_TYPE.CHANNEL_FEED should exist and equals to "Channel Feed"', function () { | ||
expect(CONTENT_TYPE.CHANNEL_FEED).toEqual('Channel Feed'); | ||
}); | ||
it('CONTENT_TYPE.SINGLE_VIDEO should exist and equals to "Single Video"', function () { | ||
expect(CONTENT_TYPE.SINGLE_VIDEO).toEqual('Single Video'); | ||
}); | ||
describe('Unit : Enum LAYOUTS', function () { | ||
it('LAYOUTS should exist and be an object', function () { | ||
expect(typeof LAYOUTS).toEqual('object'); | ||
}); | ||
it('LAYOUTS.listLayouts should be an array', function () { | ||
expect(Array.isArray(LAYOUTS.listLayouts)).toEqual(true); | ||
}); | ||
it('LAYOUTS.listLayouts[0].name should exist and equals to "List_Layout_1"', function () { | ||
expect(LAYOUTS.listLayouts[0].name).toEqual('List_Layout_1'); | ||
}); | ||
it('LAYOUTS.listLayouts[1].name should exist and equals to "List_Layout_2"', function () { | ||
expect(LAYOUTS.listLayouts[1].name).toEqual('List_Layout_2'); | ||
}); | ||
it('LAYOUTS.listLayouts[2].name should exist and equals to "List_Layout_3"', function () { | ||
expect(LAYOUTS.listLayouts[2].name).toEqual('List_Layout_3'); | ||
}); | ||
it('LAYOUTS.listLayouts[3].name should exist and equals to "List_Layout_4"', function () { | ||
expect(LAYOUTS.listLayouts[3].name).toEqual('List_Layout_4'); | ||
}); | ||
}); | ||
}); |