Skip to content

Commit

Permalink
fix(linked-items): add href to linked tab and subnav items
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Jan 24, 2022
1 parent 24b34b8 commit 5340369
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addon/components/-private/linked-list-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
}}
...attributes
>
<a href={{this.href}} {{on "click" this.navigate}}>{{yield}}</a>
<a href={{@href}} {{on "click" this.navigate}}>{{yield}}</a>
</li>
4 changes: 3 additions & 1 deletion tests/integration/components/uk-subnav/item-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module("Integration | Component | uk subnav/item", function (hooks) {
});

test("can navigate via href", async function (assert) {
assert.expect(3);
assert.expect(4);

this.owner.lookup("service:router").transitionTo = (href) => {
assert.step("navigate");
Expand All @@ -49,6 +49,8 @@ module("Integration | Component | uk subnav/item", function (hooks) {

await render(hbs`<UkSubnav::Item @href="/">Test</UkSubnav::Item>`);

assert.dom("a").hasAttribute("href", "/");

await click("a");

assert.verifySteps(["navigate"]);
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/components/uk-tab/item-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module("Integration | Component | uk tab/item", function (hooks) {
});

test("can navigate via href", async function (assert) {
assert.expect(3);
assert.expect(4);

this.owner.lookup("service:router").transitionTo = (href) => {
assert.step("navigate");
Expand All @@ -46,6 +46,8 @@ module("Integration | Component | uk tab/item", function (hooks) {

await render(hbs`<UkTab::Item @href="/">Test</UkTab::Item>`);

assert.dom("a").hasAttribute("href", "/");

await click("a");

assert.verifySteps(["navigate"]);
Expand Down

0 comments on commit 5340369

Please sign in to comment.