Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
test(util): Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlee44 committed Oct 17, 2016
1 parent 2109be3 commit 8634658
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/unit/util.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,24 @@ describe('Mac Util', function() {
});
});

describe('parseUrlPath', function () {
it('should parse all components', function () {
var object = util.parseUrlPath('http://www.example.com/macgyver?season=1&episode=3&time=12:23');

expect(object.fullPath).toBe('http://www.example.com/macgyver?season=1&episode=3&time=12:23');
expect(object.path).toBe('http://www.example.com');
expect(object.pathComponents.length).toBe(4);
expect(object.pathComponents[0]).toBe('http:');
expect(object.pathComponents[1]).toBe('');
expect(object.pathComponents[2]).toBe('www.example.com');
expect(object.pathComponents[3]).toBe('macgyver');
expect(object.verb).toBe('macgyver');
expect(object.queries.season).toBe('1');
expect(object.queries.episode).toBe('3');
expect(object.queries.time).toBe('12:23');
})
});

describe('getCssVendorName', function () {
var testEl = angular.element('<div />')[0];

Expand All @@ -324,5 +342,11 @@ describe('Mac Util', function() {
var name = util.getCssVendorName(testEl, 'doesNotExist');
expect(name).toBe('doesNotExist');
});

it('should return with vendor prefix', function () {
testEl.style['webkitAnimation'] = 'test';
var name = util.getCssVendorName(testEl, 'animation');
expect(name).toBe('webkitAnimation');
});
});
});

0 comments on commit 8634658

Please sign in to comment.