var Obj = Y.Object,
name: 'HistoryHash',
setUp: function () {
this.history = new Y.HistoryHash();
},
tearDown: function () {
delete this.history;
},
_should: {
ignore: {
}
},
// -- onhashchange ---------------------------------------------------------
'synthetic hashchange event should fire when the hash changes': function () {
var changed;
Y.once('hashchange', function (e) {
changed = true;
Y.ObjectAssert.ownsKeys([
'oldHash',
'oldUrl',
'newHash',
'newUrl'
], e, 'Event facade is missing one or more properties');
if (Y.HistoryBase.nativeHashChange) {
}
}, win);
this.wait(function () {
}, 50);
},
'hashchange should be case-sensitive (except in IE8+)': function () {
var changed;
Y.once('hashchange', function () {
changed = true;
}, win);
this.wait(function () {
changed = false;
Y.once('hashchange', function () {
changed = true;
}, win);
this.wait(function () {
}, 50);
}, 50);
},
'hashchange should NOT be case-sensitive in IE8+': function () {
var changed;
Y.once('hashchange', function () {
changed = true;
}, win);
this.wait(function () {
changed = false;
Y.once('hashchange', function () {
changed = true;
}, win);
this.wait(function () {
}, 50);
}, 50);
},
// -- Static Properties and Methods ----------------------------------------
'createHash() should create a hash string from an object': function () {
},
'decode() should decode URI components with + for space': function () {
},
'encode() should encode URI components with + for space': function () {
},
'setHash() should set the hash': function () {
},
'getHash() should get the current raw (not decoded) hash string': function () {
},
'getUrl() should get the current URL': function () {
},
'parseHash() should parse a hash string into an object': function () {
},
'parseHash() should use the current hash if no argument is provided': function () {
},
'replaceHash() should replace the hash': function () {
},
// -- Constructor ----------------------------------------------------------
'bookmarked state should be merged into initialState': function () {
this.wait(function () {
}, 50);
},
// -- Instance Methods -----------------------------------------------------
'add() should change the hash': function () {
},
'replace() should replace the hash': function () {
},
// -- Bugs -----------------------------------------------------------------
'Setting an unencoded hash value outside of HistoryHash should not result in two history entries': function () {
// Necessary to avoid catching a late-firing event from a previous test.
this.wait(function () {
var changes = 0,
changes += 1;
}, win);
this.wait(function () {
}, 105);
}, 51);
},
'Setting a non-string value should not result in two history entries': function () {
this.wait(function () {
var changes = 0,
changes += 1;
});
this.wait(function () {
this.wait(function () {
}, 105);
}, 105);
}, 51);
}
}));