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

feat: Add support for firing all transition events #1036

Merged
merged 2 commits into from Sep 22, 2021

Conversation

bpinto
Copy link
Contributor

@bpinto bpinto commented Sep 21, 2021

What:

Add support for firing all transition events.

Why:

Currently only transitionEnd even is supported.

How:

Defining all other events, transitionCancel, transitionRun, transitionStart.

Checklist:

  • Documentation added to the docs site
  • Tests
  • TypeScript definitions updated
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 21, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a689fb0:

Sandbox Source
react-testing-library-examples Configuration

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

The PR is missing the changes from running npm run format.

Make sure that npm run validate passes locally.

@bpinto
Copy link
Contributor Author

bpinto commented Sep 22, 2021

Sorry for the bad start, I knew I shouldn't have opened the PR yesterday as it was too late for me. I have properly formatted the code now.

npm run validate is failing locally (2 tests are failing) but same tests are failing on main branch. So I'm guessing it's something on my local environment that's not correctly setup.

It should pass on CI as the test seems unrelated to this change.

@eps1lon
Copy link
Member

eps1lon commented Sep 22, 2021

Sorry for the bad start, I knew I shouldn't have opened the PR yesterday as it was too late for me. I have properly formatted the code now.

There's nothing to appologize for. I just left the review so that you're notified of the CI failure since GitHub blocks CI for 1st time contributors.

npm run validate is failing locally (2 tests are failing) but same tests are failing on main branch. So I'm guessing it's something on my local environment that's not correctly setup.

Yeah, we're not sure why these are failing for some people (myself included) locally but pass CI.

@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #1036 (a689fb0) into main (45830f5) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #1036   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines          920       920           
  Branches       286       284    -2     
=========================================
  Hits           920       920           
Flag Coverage Δ
node-12 100.00% <ø> (ø)
node-14 100.00% <ø> (ø)
node-16.9.1 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/event-map.js 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45830f5...a689fb0. Read the comment docs.

@eps1lon eps1lon changed the title Add support for firing all transition events feat: Add support for firing all transition events Sep 22, 2021
@eps1lon eps1lon added the enhancement New feature or request label Sep 22, 2021
@eps1lon eps1lon merged commit 669602c into testing-library:main Sep 22, 2021
@github-actions
Copy link

🎉 This PR is included in version 8.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bpinto bpinto deleted the all-transition-events branch September 23, 2021 02:02
@bpinto
Copy link
Contributor Author

bpinto commented Sep 29, 2021

@eps1lon about these two tests that are failing locally, if we remove the highlighting then they pass, not sure if you have noticed this.

  const codeFrame = codeFrameColumns(
    rawFileContents,
    {
      start: {line, column},
    },
    {
      highlightCode: false, // no highlight
      linesBelow: 0,
    },
  )
  return `${frameLocation}\n${codeFrame}\n` // no dim
}

This seems very suspicious:

https://github.com/joaogranado/jest-serializer-ansi/blob/c8c5e8cbc0f804f9fe195dfd27625ea0b3d2a062/index.js#L13-L16

@eps1lon
Copy link
Member

eps1lon commented Sep 29, 2021

Thanks for looking into it! Could you open an issue so that we can track it better? Closed PRs are usually not watched

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants