mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
add test for persisting global state
This commit is contained in:
parent
a9167bbd0c
commit
d431b278d0
1 changed files with 16 additions and 0 deletions
|
@ -90,6 +90,22 @@ define(function (require) {
|
|||
expect(kbnUrl.reload.callCount).to.be(uniqWordCount);
|
||||
});
|
||||
|
||||
it('should persist global state', function () {
|
||||
var wordCount = _.random(3, 6);
|
||||
var globalStateSpy = sinon.spy(globalStateMock, 'writeToUrl');
|
||||
var urls = faker.Lorem.words(wordCount).map(function (url) {
|
||||
return '/' + url;
|
||||
});
|
||||
|
||||
urls.forEach(function (url) {
|
||||
kbnUrl.change(url);
|
||||
|
||||
expect($location.url()).to.be(url);
|
||||
});
|
||||
|
||||
expect(globalStateSpy.callCount).to.be(wordCount);
|
||||
});
|
||||
|
||||
it('should reload when forceReload is true', function () {
|
||||
var words = [faker.Lorem.words(_.random(2, 6)).join('/')];
|
||||
words.push(words[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue