Skip to content

Commit

Permalink
Removing restrictive list of tagNames. Ensuring string comparison is …
Browse files Browse the repository at this point in the history
…correct casing
  • Loading branch information
scalvert committed Oct 3, 2019
1 parent 19a8a0b commit 79d952c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 160 deletions.
9 changes: 1 addition & 8 deletions lib/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import matchesSelector from './assertions/matches-selector';
import elementToString from './helpers/element-to-string';
import collapseWhitespace from './helpers/collapse-whitespace';
import { toArray } from './helpers/node-list';
import TAG_NAMES from './helpers/tag-names';

export default class DOMAssertions {
constructor(
Expand Down Expand Up @@ -983,14 +982,8 @@ export default class DOMAssertions {
throw new TypeError(`You must pass a string to "hasTag". You passed ${tagName}.`);
}

if (!TAG_NAMES.includes(tagName.toLowerCase())) {
throw new Error(
`The tagName '${tagName}' is not a valid HTML tag. You must provide a valid HTML tag`
);
}

actual = element.tagName.toLowerCase();
expected = tagName;
expected = tagName.toLowerCase();

if (actual === expected) {
if (!message) {
Expand Down
152 changes: 0 additions & 152 deletions lib/helpers/tag-names.ts

This file was deleted.

0 comments on commit 79d952c

Please sign in to comment.