Add AudioRecorderComponent sample tests#4169
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private void createPlaceholderFile(String path) throws IOException { | ||
| FileWriter writer = new FileWriter(path); | ||
| try { | ||
| writer.write("recording"); | ||
| } finally { |
There was a problem hiding this comment.
Placeholder file uses host FS instead of Codename One storage
The cancellation test builds a dummy recording file with new FileWriter(path) even though AudioRecorderComponentSample.recordAudio() returns Codename One file URLs (file://app/...) managed by the in-memory TestCodenameOneImplementation storage. Writing via java.io never populates that mock file system (and will throw when the file:// prefix resolves to a non-existent host directory), so the test either fails before exercising the cancel flow or checks deletion against the wrong location. Use FileSystemStorage/Codename One streams (and matching existence checks) so the placeholder resides in the same storage the component deletes.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task