Wrapped the test suites in waitFor to remove react warning - #231
Open
11yashiagrawal wants to merge 2 commits into
Open
Wrapped the test suites in waitFor to remove react warning#23111yashiagrawal wants to merge 2 commits into
11yashiagrawal wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR wraps asynchronous test flows in waitFor() to resolve React warnings (particularly from AnimatePresence elements) and update several test suites and component files. Key changes include updating test imports to include waitFor, refactoring tests to asynchronous patterns, and cleaning up obsolete commented code in Carousel-related files.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/elements/PopOver/PopOver.test.tsx | Added waitFor wrappers for asynchronous assertions in PopOver tests |
| ui/elements/Modal/MultiStepModal/index.test.tsx | Updated test callbacks to async waitFor assertions |
| ui/elements/Modal/Modal.test.tsx | Refactored tests to use waitFor and updated assertions accordingly |
| ui/elements/Modal/ConfirmationDialog/index.test.tsx | Wrapped confirmation dialog tests in waitFor for async evaluation |
| ui/elements/Form/Dropdown/Dropdown.test.tsx | Refactored single and multi select mode tests to include waitFor calls |
| ui/elements/Carousel/types.ts | Commented out $translateX property reflecting removal of unused state |
| ui/elements/Carousel/Carousel.tsx | Updated scrolling behavior and removed unused translateX state |
| ui/elements/Carousel/Carousel.styles.ts | Removed transform styles in favor of native scrolling styles |
| ui/elements/BottomSheet/BottomSheet.test.tsx | Wrapped bottom sheet tests in waitFor for async rendering assertions |
| ui/elements/Accordion/Accordion.test.tsx | Updated accordion tests to use waitFor for asynchronous expectations |
| ui/css/index.scss | Commented out grauity-icons import |
| .gitmodules | Updated submodule URL from SSH to HTTPS |
Comments suppressed due to low confidence (2)
ui/elements/Form/Dropdown/Dropdown.test.tsx:177
- An empty test block appears to have been left before the async test for multi select mode with action buttons. Please remove the redundant empty test block to avoid confusion.
it('Should run entire flow correctly in multi select mode if action buttons are present', () => {
ui/elements/Carousel/Carousel.styles.ts:53
- Since native scrolling is now used, remove the deprecated transform rule to keep the CSS clean and maintainable.
- transform: translateX(${(props) => props.$translateX}px);
| const containerRef = useRef<HTMLDivElement | null>(null); | ||
|
|
||
| const [translateX, setTranslateX] = useState(0); | ||
| // const [translateX, setTranslateX] = useState(0); |
There was a problem hiding this comment.
[nitpick] If the translateX state is no longer used, consider removing this commented-out code for clarity.
Suggested change
| // const [translateX, setTranslateX] = useState(0); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #50
The AnimatePresence Elements were giving out warning on running tests, so the asynchronous test suites have been wrapped in waitFor() for a smooth run.