ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Re-evaluate `Episode` test

Open lindboe opened this issue 1 year ago • 0 comments

On some prior changes to make react-i18next work, what the Episode.test.ts test returned changed: https://github.com/infinitered/ignite/pull/2788/files#diff-4cc30eb5073b136225c5e125f89e9633099446e21bf96af2bc878a128c56878cR30. The reason why is not yet clear.

However, the translation is done correctly in the running app, but it doesn't affect the app anyways, because these accessibility labels are never actually read out (see https://github.com/infinitered/ignite/issues/2730). (When inspecting the value in the models via debugging, I verified it translate them correctly after the linked change to react-i18next):

// DemoPodcastListScreen.tsx

const EpisodeCard = ...
 ...
  console.log("EPISODE DATA", episode.duration)

  return (
    <Card
      style={themed($item)}
      verticalAlignment="force-footer-bottom"
 ...

// prints
 LOG  EPISODE DATA {"accessibilityLabel": "Duration: 0 hours 44 minutes 55 seconds", "textLabel": "44:55"}
 LOG  EPISODE DATA {"accessibilityLabel": "Duration: 1 hours 2 minutes 30 seconds", "textLabel": "1:2:30"}
 LOG  EPISODE DATA {"accessibilityLabel": "Duration: 0 hours 25 minutes 7 seconds", "textLabel": "25:7"}

Therefore, this test doesn't appear to be very useful. It's not asserting that the label is shown in the UI nor that we can actually translate correctly. It did, at least, previously assert that the data was being passed to the translate call, but apparently that data still is being passed in during an actual app run, which implies that our test may not match our application.

Determine what we should be testing and write tests that more accurately verify the behavior of the application.

lindboe avatar Sep 27 '24 22:09 lindboe