Skip to content

Commit

Permalink
Adding tests to make sure tagName works as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
kmillns committed Nov 8, 2017
1 parent bebc185 commit 2e22634
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions tests/unit/components/a11y-landmark-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ test('it fails to determine ariaRole when tagName and landmarkRole are both prov
}, buildEmberAssertion(expectedErrorMessage));
});

test('it defaults to div[role="region"] when neither tagName nor landmarkRole are provided', function(assert) {
test('it defaults to tagName "div" and role "region" when neither tagName nor landmarkRole are provided', function(assert) {
const component = this.subject({});

const ariaRole = component.get('ariaRole');
Expand All @@ -97,7 +97,7 @@ test('it defaults to div[role="region"] when neither tagName nor landmarkRole ar
assert.equal(tagName, 'div');
});

test('it sets tagName correctly when tagName is "form" and landmarkRole is "search"', function(assert) {
test('it sets tagName to "form" when tagName is "form" and landmarkRole is "search"', function(assert) {
const component = this.subject({
tagName: 'form',
landmarkRole: 'search'
Expand All @@ -106,3 +106,21 @@ test('it sets tagName correctly when tagName is "form" and landmarkRole is "sear

assert.equal(tagName, 'form');
});

test('it sets tagName to "form" when tagName is "form" and no landmarkRole is provided', function(assert) {
const component = this.subject({
tagName: 'form'
});
const tagName = component.get('tagName');

assert.equal(tagName, 'form');
});

test('it sets tagName to "div" when landmarkRole is provided', function(assert) {
const component = this.subject({
landmarkRole: 'navigation'
});
const tagName = component.get('tagName');

assert.equal(tagName, 'div');
});

0 comments on commit 2e22634

Please sign in to comment.