-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): Added unitary tests and protractor tests for the new url-…
…hash-center property
- Loading branch information
1 parent
212cb70
commit d43ff38
Showing
2 changed files
with
67 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
describe('Loading center-example.html', function() { | ||
|
||
var ptor, driver; | ||
beforeEach(function() { | ||
ptor = protractor.getInstance(); | ||
browser.get('url-hash-center-example.html'); | ||
driver = ptor.driver; | ||
}, 30000); | ||
|
||
it('should update the url in the center value is changed from the form', function() { | ||
element(by.xpath('//input[1]')).clear(); | ||
element(by.xpath('//input[1]')).sendKeys('9'); | ||
element(by.xpath('//input[2]')).clear(); | ||
element(by.xpath('//input[2]')).sendKeys('7'); | ||
element(by.xpath('//input[3]')).clear(); | ||
element(by.xpath('//input[3]')).sendKeys('4'); | ||
// Wait for zoom animation | ||
ptor.sleep(300); | ||
expect(browser.getCurrentUrl()).toMatch(/c=9.102096738726456:7.03125:14$/); | ||
}); | ||
|
||
it('should update the map center model if the url changes', function() { | ||
browser.get("url-hash-center-example.html#?c=9.102096738726456:7.03125:14"); | ||
expect(element(by.xpath('//input[1]')).getAttribute("value")).toBe("9.102096738726456"); | ||
expect(element(by.xpath('//input[2]')).getAttribute("value")).toBe("7.03125"); | ||
expect(element(by.xpath('//input[3]')).getAttribute("value")).toBe("14"); | ||
}); | ||
}); |
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