Skip to content

Commit

Permalink
fix: Optional previous element subject (#11)
Browse files Browse the repository at this point in the history
This fix is small, but removed the error of `Cannot read property 'ownerDocument' of undefined`. This change will change the error to be the built-in Cypress error stating the previous subject must be an element (if supplied). It will then output the subject and previously run command.
  • Loading branch information
NicholasBoll authored and kuceb committed Dec 5, 2019
1 parent a00e9fc commit 446ad89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const tabSequence = require('ally.js/query/tabsequence')

const { _, Promise } = Cypress

Cypress.Commands.add('tab', { prevSubject: 'optional' }, (subject, opts = {}) => {
Cypress.Commands.add('tab', { prevSubject: ['optional', 'element'] }, (subject, opts = {}) => {

const options = _.defaults({}, opts, {
shift: false,
Expand Down

0 comments on commit 446ad89

Please sign in to comment.