Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Check that link-to bindings work properly #315

Merged
merged 1 commit into from
Feb 7, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,9 @@ if (!config.stripTestSelectors) {
test('it transforms data-test params to hash pairs on components', function(assert) {
assert.dom('.test11 div[data-test-something]').exists('data-test-something exists');
});

test('it binds data-test attributes on {{link-to}} components', function(assert) {
assert.dom('.test-link-to-block a').hasAttribute('data-test-foo', 'bar');
assert.dom('.test-link-to-inline a').hasAttribute('data-test-foo', 'bar');
});
}
4 changes: 4 additions & 0 deletions tests/dummy/app/templates/bind-test.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
{{/if}}

<div class="test11">{{data-test-component data-test-something some-prop="prop"}}</div>

<div class="test-link-to-block">{{#link-to "index" data-test-foo="bar"}}Label{{/link-to}}</div>

<div class="test-link-to-inline">{{link-to "Label" "index" data-test-foo="bar"}}</div>