Created
March 8, 2017 20:15
-
-
Save glendaviesnz/d5d9b160c698fcbc2c32f2bd1a7dac5f to your computer and use it in GitHub Desktop.
jasmine.Clock.tick and rxjs
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
describe('formPanel: FormFilterStore', function () { | |
it('Should generate new filters when formFilterChangeStream emits', function () { | |
jasmine.Clock.useMock(); | |
formFilterStore.currentFormFiltersStream.subscribe(function(filters){ | |
expect(filters.CQLFilter).toEqual('A new Cql Filter'); | |
expect(filters.APIFilter).toEqual('[A new Api filter]'); | |
}); | |
formFilterStore.formFilterChangeStream.onNext({ | |
filterType: 'date', | |
filters: {cqlFilterString: "A new Cql Filter", apiFilterString: "A new Api filter"} | |
}); | |
// rxjs subject has debounce of 1 sec so force clock past this | |
jasmine.Clock.tick(1001); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment