Its throwing error: search is not configurable
it('should have search keyword', function () {
spyOnProperty(window.location, 'search').and.returnValue("?q=jag");
expect(window.location.search).toBe("?q=jag");
});
beforeEach(function () {
window.history.pushState({}, '', "?q=jag");
})
it('should have search keyword', function () {
expect(window.location.search).toBe("?q=jag");
expect($('#decoder-search-bar-input').val()).toEqual('jag');
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.