• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 14498282071 / 2
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: refactor-subsequences-2025
DEFAULT BRANCH: master
Ran 16 Apr 2025 05:38PM UTC
Files 647
Run time 18s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Apr 2025 04:59PM UTC coverage: 80.957% (+2.1%) from 78.831%
14498282071.2

push

github

web-flow
test(storybook): languageSelector search DEV-99 (#5670)

### 📣 Summary
Add Storybook test to verify that searching LanguageSelector works
correctly.

### 💭 Notes

Changes here:
- Installed `msw` and `msw-storybook-addon` for mocking API calls
- This piece of code requires a directory with `mockServiceWorker.js` to
be present, so I created "msw-mocks" directory (not sure about the name,
official documentation suggest using "public", but it's a very vague
name)
- To make mocking calls possible, I created files for mocks of two
stores:
  - `languagesListStore.mock.ts` that has big JSON responses
  - `envStore.mock.ts` that has one smaller JSON response
- Added single test to `LanguageSelector.stories.tsx` 
- Configuring the component required me to mock few different calls, see
`parameters.msw.handlers`
- `TestSearchSwedish` uses searchbox of `LanguageSelector` to search for
"swed" and to find "Swedis (sv)"
- I've added `sleep` function as suggested in Storybook documentation
(am considering moving this somewhere, maybe `.storybook/utils.ts`?) and
I don't particullary like it, but I couldn't find some better way to
await some acions/calls to be finished. I guess it mimics how user acts
in the UI better :shrug:
- There is also waitFor, but I found that the code looks less clear, and
the result is similar (`waitFor` is better in that it checks every 10ms
until final timeout):
       ```ts
       await waitFor(
         async () => {
           const noSearchItem = await canvas.findByText(/^Arabic/)
           await expect(noSearchItem).toBeInTheDocument()
         },
         { timeout: 2000 },
       )
       // VS
       await sleep(2000)
       const noSearchItem = await canvas.findByText(/^Arabic/)
       await expect(noSearchItem).toBeInTheDocument()
       ```
- Removed some obsolete properties from `EnvironmentResponse` interface 
- Fixed bug in `LanguageSelector`: when clearing the searchbox, initial
list of results was not refetched :bug: :hammer:... (continued)

6180 of 9799 branches covered (63.07%)

23454 of 28971 relevant lines covered (80.96%)

0.81 hits per line

Source Files on job 14498282071.2
  • Tree
  • List 647
  • Changed 19
  • Source Changed 0
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 14498282071
  • 1bbd0d6d on github
  • Prev Job for on main (#14497468056.1)
  • Next Job for on main (#14536942500.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc