mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-15 04:40:02 +01:00
Shorten UI code with new $step method (#710)
* 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
This commit is contained in:
committed by
Jeffrey Warren
parent
0eb3f263f9
commit
257113a948
40
test/ui/spec/urlHash.spec.js
Normal file
40
test/ui/spec/urlHash.spec.js
Normal file
@@ -0,0 +1,40 @@
|
||||
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');
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user