mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-11 10:49:59 +01:00
* update dist Signed-off-by: tech4GT <varun.gupta1798@gmail.com> dist update Revert "dist update" This reverts commit 9ee2a987e8f978961656ae8f71f6e6702bbbd30d. * Merge remote-tracking branch 'upstream/main' into main * add dist * add new func * update itermediate * changes * fix gitignore * use scopeQuery * add mapHtmlTypes test * scopeQuery tests added * try something * change * fix stepui test * Remove double quotes * update new code * refactor to spec
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
describe('URL manipulation methods', function() {
|
|
|
|
var UrlHash = require('../../../examples/lib/urlHash');
|
|
var urlHash;
|
|
var params = {
|
|
module: 'brightness',
|
|
brightness: 50
|
|
};
|
|
|
|
beforeEach(()=>{
|
|
urlHash = UrlHash;
|
|
|
|
spyOn(urlHash, 'getUrlHashParameters');
|
|
spyOn(urlHash, 'getUrlHashParameter');
|
|
spyOn(urlHash, 'setUrlHashParameters');
|
|
spyOn(urlHash, 'setUrlHashParameter');
|
|
|
|
urlHash.getUrlHashParameters();
|
|
urlHash.getUrlHashParameter('module');
|
|
urlHash.setUrlHashParameters(params);
|
|
urlHash.setUrlHashParameter('module', 'brightness');
|
|
});
|
|
|
|
it('gets url hash params from window hash', function() {
|
|
expect(urlHash.getUrlHashParameters).toHaveBeenCalled();
|
|
});
|
|
|
|
it('gets url hash param from params object', function() {
|
|
expect(urlHash.getUrlHashParameter).toHaveBeenCalledWith('module');
|
|
});
|
|
|
|
it('accepts param object and sets url hash params', function() {
|
|
expect(urlHash.setUrlHashParameters).toHaveBeenCalledWith(params);
|
|
});
|
|
|
|
it('accepts param key-value pair and sets url hash params', function() {
|
|
expect(urlHash.setUrlHashParameter).toHaveBeenCalledWith('module', 'brightness');
|
|
});
|
|
|
|
}); |