-
Notifications
You must be signed in to change notification settings - Fork 206
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
[Android] add LocalClock to control time for screenshot test #1224
[Android] add LocalClock to control time for screenshot test #1224
Conversation
c39834b
to
9cbdc1d
Compare
bf4a1bc
to
c8821ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to work on #1219 but was told that the PR is already there.
I commented where I was concerned.
import kotlinx.datetime.Clock | ||
|
||
@Suppress("CompositionLocalAllowList") | ||
val LocalClockProvider = compositionLocalOf<Clock> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, using staticCompositionLocalOf
would be better performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the advice! Let me check the function and replace with it!
Hmm... The format error cannot be resolved even if I suppressed it 🫠... |
34d9afb
to
ca1ca65
Compare
Hi @tkhs0604! Codes seem to be unformatted. To resolve this issue, please run |
021e82f
to
54e8242
Compare
onTimetableItemClick = { }, | ||
onBookmarkIconClick = { }, | ||
) | ||
CompositionLocalProvider(LocalClock provides FakeClock) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takahirom
It does not seem like it works well...
Do you know how I can overwrite the CompositionLocal in test environment? 🤔
Maybe, since there is no setContent in KaigiAppTest, so the only way is to add like ClockTestRule or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure too.
By the way, you might have to fix the commit history 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I'll investigate the cause again 🙏
And regarding your BTW comment, which commits? All?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I might see old commits 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the comment and rerun the test. Let's see what screenshots the tests take.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙌
54e8242
to
fb54dac
Compare
fb54dac
to
046fba6
Compare
…controll_time_in_preview
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Issue
Overview (Required)
Links
Screenshot (Optional if screenshot test is present or unrelated to UI)
Movie (Optional)