addressbar
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -144,2 +144,8 @@ var URI = require('urijs'); | ||
Object.defineProperty(eventEmitter, 'hash', { | ||
get: function () { | ||
return URI(location.href).hash(); | ||
} | ||
}); | ||
/* | ||
@@ -146,0 +152,0 @@ This code is from the Page JS source code. Amazing work on handling all |
{ | ||
"name": "addressbar", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Makes the addressbar of the browser work just like a normal input", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,2 +29,3 @@ # addressbar | ||
addressbar.pathname // "/" | ||
addressbar.hash // "" | ||
@@ -31,0 +32,0 @@ // Prevent route changes on hyperlinks |
12
test.js
@@ -375,4 +375,16 @@ var webdriver = require('selenium-webdriver'); | ||
}); | ||
driver.findElement(by.id('hash')).getText().then(function (text) { | ||
test.equal(text, ''); | ||
}); | ||
driver.findElement(by.id('messages')).click(); | ||
driver.findElement(by.id('pathname')).getText().then(function (text) { | ||
test.equal(text, '/'); | ||
}); | ||
driver.findElement(by.id('hash')).getText().then(function (text) { | ||
test.equal(text, '#/messages'); | ||
}); | ||
driver.quit().then(test.done); | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
310916
1580
50