Closed heiko-hardt closed 11 years ago
Hi, thanks for reporting. Yes, I can reproduce the problem. This seems to work, i.e. splitting the assignment and the checking of the hash in different uit.runs calls, by which uitest.js waits a little between them... I will investigate this further...
it('should return the hash (#dummy.html)', function() {
uit.runs(function(window){
window.location.hash = 'dummy.html';
});
uit.runs(function(window){
expect(window.location.hash).toBe('#dummy.html');
});
});
Ah ha, somehow the iframe gets reloaded, i.e. the following test fails:
it('should return the hash (#dummy.html)', function() {
uit.runs(function(window){
var win = window;
win.location.hash = 'dummy.html';
win.test = true;
});
uit.runs(function(window){
expect(window.test).toBe(true);
expect(window.location.hash).toBe('#dummy.html');
});
});
Hi, thanks a lot for reporting this! I previously had an unreproducible problem with FF, and it turns out that it was the very same cause as your issue.
Reason behind this: We are rewriting the document using document.open/write/close. For IE, we need to do this inside of a timeout. However, doing this in a timeout results in the problem you mentioned in FF.
Tobias
Thanks for fixing ;-)
Hi Tobias,
the following code returns an 'empty string' as "win.location.hash" in FireFox. IE, Chrome, Safari, ... works well:
I know this example seems to make no sense, but i run into the same problem if my app change the hash. FireFox only returns an initial hash.
Thanks in advance Heiko