mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 15:40:22 +00:00
25 lines
714 B
JavaScript
25 lines
714 B
JavaScript
UrlWatcherTest = TestCase('UrlWatcherTest');
|
|
|
|
UrlWatcherTest.prototype.testUrlWatcher = function () {
|
|
expectAsserts(2);
|
|
var location = {href:"http://server", hash:""};
|
|
var watcher = new UrlWatcher(location);
|
|
watcher.delay = 1;
|
|
watcher.watch(function(url){
|
|
assertEquals('http://getangular.test', url);
|
|
});
|
|
watcher.setTimeout = function(fn, delay){
|
|
assertEquals(1, delay);
|
|
location.href = "http://getangular.test";
|
|
watcher.setTimeout = function(fn, delay) {
|
|
};
|
|
fn();
|
|
};
|
|
watcher.start();
|
|
};
|
|
|
|
FunctionTest = TestCase("FunctionTest");
|
|
|
|
FunctionTest.prototype.testEscapeHtml = function () {
|
|
assertEquals("<div>&amp;</div>", escapeHtml('<div>&</div>'));
|
|
};
|