Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Breiding <[email protected]>
  • Loading branch information
mjhenkes and chrisbreiding authored Oct 21, 2021
1 parent 2be65ce commit 1ae3e29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('src/cypress/selector_playground', () => {
expect(SelectorPlayground.getSelectorPriority()).to.eql(selectorPriority)
})

it('throws if selector:playground:priority if selectorPriority contains an unsupported priority', () => {
it('throws if selectorPriority contains an unsupported priority', () => {
const fn = () => {
SelectorPlayground.defaults({
selectorPriority: [
Expand All @@ -55,7 +55,7 @@ describe('src/cypress/selector_playground', () => {
.and.include('`Cypress.SelectorPlayground.defaults()` called with invalid `selectorPriority` property. It must be one of: `data-*`, `id`, `class`, `tag`, `attributes`, `nth-child`. You passed: `name`')
})

it('throws if selector:playground:priority has an unsupported priority that contains a substring of a valid priority', () => {
it('throws if selectorPriority has an unsupported priority that contains a substring of a valid priority', () => {
const fn = () => {
SelectorPlayground.defaults({
selectorPriority: [
Expand Down
2 changes: 1 addition & 1 deletion packages/driver/src/cypress/selector_playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default {
// Validate that the priority is one of: "data-*", "id", "class", "tag", "attributes", "nth-child"

selectorPriority.forEach((priority) => {
if (!priority.match(/^(data\-.*|id|class|tag|attributes|nth\-child)$/)) {
if (!/^(data\-.*|id|class|tag|attributes|nth\-child)$/.test(priority)) {
$errUtils.throwErrByPath('selector_playground.defaults_invalid_priority', {
args: { arg: priority },
})
Expand Down

0 comments on commit 1ae3e29

Please sign in to comment.