Skip to content

test: should sync form input changes with URL query parameters#1141

Open
Shahar17452312 wants to merge 9 commits intohasadna:mainfrom
Shahar17452312:test_URL_timeline
Open

test: should sync form input changes with URL query parameters#1141
Shahar17452312 wants to merge 9 commits intohasadna:mainfrom
Shahar17452312:test_URL_timeline

Conversation

@Shahar17452312
Copy link
Copy Markdown
Collaborator

@Shahar17452312 Shahar17452312 commented Jun 3, 2025

Test url timeline-create test with name: Should sync form input changes with URL query parameters

Resolving #1109

note:
The test on line 173 is currently failing because when the URL changes, the application reverts to the latest route.
I verified this behavior in the UI as well — if you fill in all the inputs and then manually change one of them in the URL, the app navigates back to the last route state.

screenshot:

Screenshot 2025-06-03 232915

@Shahar17452312 Shahar17452312 requested a review from NoamGaash as a code owner June 3, 2025 20:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2025

@NoamGaash NoamGaash changed the title Test url timeline-create test with name: Should sync form input changes with URL query parameters test: should sync form input changes with URL query parameters Jun 4, 2025
@Shahar17452312
Copy link
Copy Markdown
Collaborator Author

It is my first time writing to open source project, hope it's ok. Please let me know if there is any problem :)
@NoamGaash

Copy link
Copy Markdown
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@NoamGaash
Copy link
Copy Markdown
Member

Seems like some of the tests are failing - we can update the branch after merging #1136 to see if it helps

@Shahar17452312
Copy link
Copy Markdown
Collaborator Author

The test still fails after the merge.
Still the same problem

@NoamGaash NoamGaash requested a review from AvivAbachi as a code owner July 12, 2025 07:51
@AvivAbachi
Copy link
Copy Markdown
Collaborator

@NoamGaash @Shahar17452312
The problem is not in the test.
The URL query params don't sync after init MainRoute.tsx and SearchContext.ts.

@tatish86
Copy link
Copy Markdown

tatish86 commented Oct 30, 2025

@Shahar17452312 @AvivAbachi Hi,
I'm trying lt learn a bit about the tests and I looken into this - it fails for me in the comparing of timestamp.
I debbugged it and saw the page is loaded twice so the timestamp changed (it is not only the date but the full timestamp so it matters).
My question is why not be active and set the time as well? and not rely on setting the page clock with: page.clock.setSystemTime(getPastDate()).

@AvivAbachi
Copy link
Copy Markdown
Collaborator

AvivAbachi commented Oct 30, 2025

@tatish86
I hope it answers your question.

  • The page renders twice because React is in strict mode <React.StrictMode>
  • We are using page.clock.setSystemTime(getPastDate()) to apply mock data on same time.
  • He is trying to test whether changing the URL alters the request, but it is not working.
  • The URL is set by session storage > URL parameters > current system time in MainRoute.tsx.

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.

4 participants