Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions addon/components/docs-viewer/x-nav-item/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
{{#link-to route model
class='docs-viewer__nav-link'
activeClass='docs-viewer__nav-link--active'
data-test-id='nav-item'}}
data-test-id='nav-item'
data-test-label=label}}
{{label}}
{{/link-to}}
{{else}}
{{#link-to route
class='docs-viewer__nav-link'
activeClass='docs-viewer__nav-link--active'
data-test-id='nav-item'}}
data-test-id='nav-item'
data-test-label=label}}
{{label}}
{{/link-to}}
{{/if}}
23 changes: 11 additions & 12 deletions tests/acceptance/docs-route-test.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import { test } from 'qunit';
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { visit, click, currentURL, find } from '@ember/test-helpers';

moduleForAcceptance('Acceptance | Docs route test');
module('Acceptance | Docs route test', function(hooks) {
setupApplicationTest(hooks);

test('the docs route renders', function(assert) {
visit('/docs');
test('the docs route renders', async function(assert) {
await visit('/docs');

andThen(function() {
assert.equal(currentURL(), '/docs');
});
});

test('I can visit an autogenerated docs route', function(assert) {
visit('/docs');
click('[data-test-id="nav-item"]:contains({{docs-hero}})');
test('I can visit an autogenerated docs route', async function(assert) {
await visit('/docs');
await click('[data-test-label="{{docs-hero}}"]');

andThen(function() {
assert.ok(find('h1:contains(DocsHero)').length);
assert.equal(find('h1').textContent.trim(), 'DocsHero');
});
});