File: //home/arjun/projects/buyercall_new/buyercall/buyercall/assets/components/utils.test.js
var utils = require('./utils');
describe('Widget misc. functions', function () {
describe('getIdFromUrl', function () {
it('should return null when the URL does not contain an id', function () {
var url1 = 'http://localhost/widgets/new';
expect(utils.getIdFromUrl(url1)).toBe(null);
var url2 = 'http://localhost/widgets/edit/';
expect(utils.getIdFromUrl(url2)).toBe(null);
});
it('should return the corrent ID from the URL', function () {
var url = 'http://localhost/widgets/edit/7';
expect(utils.getIdFromUrl(url)).toBe(7);
});
});
});