mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
Use a helper function in nav_item_test.js
This commit is contained in:
parent
014db4c2e9
commit
9540112d32
1 changed files with 8 additions and 4 deletions
|
@ -15,8 +15,12 @@ module("Discourse.NavItem", {
|
||||||
test('href', function(){
|
test('href', function(){
|
||||||
expect(4);
|
expect(4);
|
||||||
|
|
||||||
equal(Discourse.NavItem.fromText('latest', {}).get('href'), '/latest', "latest");
|
function href(text, expected, label) {
|
||||||
equal(Discourse.NavItem.fromText('categories', {}).get('href'), '/categories', "categories");
|
equal(Discourse.NavItem.fromText(text, {}).get('href'), expected, label);
|
||||||
equal(Discourse.NavItem.fromText('category/bug', {}).get('href'), '/category/bug', "English category name");
|
}
|
||||||
equal(Discourse.NavItem.fromText('category/确实是这样', {}).get('href'), '/category/343434-category', "Chinese category name");
|
|
||||||
|
href('latest', '/latest', 'latest');
|
||||||
|
href('categories', '/categories', 'categories');
|
||||||
|
href('category/bug', '/category/bug', 'English category name');
|
||||||
|
href('category/确实是这样', '/category/343434-category', 'Chinese category name');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue