Skip to content

Conversation

@cee-chen
Copy link
Contributor

Summary

Super huge kudos to @miukimiu for catching this bug before it shipped! I introduced it in #5557 🙈

Repro steps

  • Open the data grid's full screen mode
  • Exit full screen mode
  • Notice the grid still has the full-screen mode height

Before

before

After

after

Checklist

- [ ] Added or updated jest and cypress tests

  • No unit tests written, mostly due to lack of existing tests + the IS_JEST_ENVIRONMENT conditional

- [ ] A changelog entry exists and is marked appropriately

  • No changelog needed as this bug isn't yet in main/production

- so grid height restores correctly after leaving full-screen mode
@cee-chen cee-chen added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Jan 31, 2022
Comment on lines +68 to +69
return IS_JEST_ENVIRONMENT
? {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chandlerprall Raising this because we just chatted about IS_JEST_ENVIRONMENT - is there any realistic way of unit testing this entire helper in Jest without running into this conditional? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Only thing that comes to mind is to rewrite relevant tests in Cypress, but ship a mockenv version for downstream test environments. That gets weird with the other two functions in this file, and we'd probably want to split this function out into its own file to mock specifically. So, no, I don't have any great ideas ☹️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooh, I totally forgot about .testenv files - I believe I can import the actual functions for the other 2 fns that don't have mocks and export only a fake fn for the one we want to target. Perfect! I'll look into that as a follow-up PR

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5580/

@cee-chen
Copy link
Contributor Author

cee-chen commented Feb 1, 2022

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5580/

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Changes LGTM; I tested on the CI branch and everything acts right, but I also cannot replicate this bug from main so we should probably get another tester too.

Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@chandlerprall, I tested the main branch locally and this issue happens to me in Chrome/Firefox/Safari.

Tested this PR in Chrome/Firefox/Safari and the issue is no longer happening!

@cee-chen cee-chen merged commit 5804943 into elastic:main Feb 1, 2022
@cee-chen cee-chen deleted the datagrid/full-screen-height branch February 1, 2022 15:59
gdimitropoulos pushed a commit to gdimitropoulos/eui that referenced this pull request Apr 21, 2022
…5580)

* Track full screen grid height separately
- so grid height restores correctly after leaving full-screen mode

* Fix nested ternary eslint warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants