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

chore: remove deprecated query* queries and prevSubject fallback code #130

Merged

Conversation

NicholasBoll
Copy link
Contributor

@NicholasBoll NicholasBoll commented Mar 12, 2020

BREAKING CHANGE: Remove query* queries. Throw an error instead. Fixing requires updating all query* to find* queries. In practice this means replacing cy.query with cy.find
BREAKING CHANGE: Remove fallback that retries chaiined query that assumes no previous subject. In practice this means starting new chains if no previous subject is required.

// Before
cy.findByText('Foo')
  .click()
  .findByText('Bar') // Element with 'Bar' text is not a child of an element with 'Foo' text
  .click()
// After
cy.findByText('Foo')
  .click()
cy.findByText('Bar')
  .click()

What:

Remove deprecated code

Why:

Keep repo clean

How:

Deprecated code was deleted and tests that verified deprecated implementation was removed

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

BREAKING CHANGE: Remove `query*` queries. Throw an error instead. Fixing requires updating all `query*` to `find*` queries. In practice this means replacing `cy.query` with `cy.find`
BREAKING CHANGE: Remove fallback that retries chaiined query that assumes no previous subject. In practice this means starting new chains if no previous subject is required.
```js
// Before
cy.findByText('Foo')
  .click()
  .findByText('Bar') // Element with 'Bar' text is not a child of an element with 'Foo' text
  .click()
// After
cy.findByText('Foo')
  .click()
cy.findByText('Bar')
  .click()
```
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work. This is awesome. I probably would've just removed them entirely. You're an awesome person for making such helpful warning messages. Thank you!

@kentcdodds kentcdodds merged commit 94c46e4 into testing-library:beta Mar 12, 2020
kentcdodds pushed a commit that referenced this pull request Mar 12, 2020
BREAKING CHANGE: Remove `query*` queries. Throw an error instead. Fixing requires updating all `query*` to `find*` queries. In practice this means replacing `cy.query` with `cy.find`

BREAKING CHANGE: Remove fallback that retries chaiined query that assumes no previous subject. In practice this means starting new chains if no previous subject is required.

```js
// Before
cy.findByText('Foo')
  .click()
  .findByText('Bar') // Element with 'Bar' text is not a child of an element with 'Foo' text
  .click()
// After
cy.findByText('Foo')
  .click()
cy.findByText('Bar')
  .click()
```
kentcdodds pushed a commit that referenced this pull request Mar 12, 2020
BREAKING CHANGE: Remove `query*` queries. Throw an error instead. Fixing requires updating all `query*` to `find*` queries. In practice this means replacing `cy.query` with `cy.find`

BREAKING CHANGE: Remove fallback that retries chaiined query that assumes no previous subject. In practice this means starting new chains if no previous subject is required.

```js
// Before
cy.findByText('Foo')
  .click()
  .findByText('Bar') // Element with 'Bar' text is not a child of an element with 'Foo' text
  .click()
// After
cy.findByText('Foo')
  .click()
cy.findByText('Bar')
  .click()
```
kentcdodds pushed a commit that referenced this pull request Mar 12, 2020
BREAKING CHANGE: Remove `query*` queries. Throw an error instead. Fixing requires updating all `query*` to `find*` queries. In practice this means replacing `cy.query` with `cy.find`

BREAKING CHANGE: Remove fallback that retries chaiined query that assumes no previous subject. In practice this means starting new chains if no previous subject is required.

```js
// Before
cy.findByText('Foo')
  .click()
  .findByText('Bar') // Element with 'Bar' text is not a child of an element with 'Foo' text
  .click()
// After
cy.findByText('Foo')
  .click()
cy.findByText('Bar')
  .click()
```
@NicholasBoll NicholasBoll deleted the pr/remove-deprecated-code branch July 10, 2020 14:45
@TheGallery TheGallery mentioned this pull request Aug 26, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants