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

kobotoolbox / kpi / 14498282071
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-1257-remove-v1-forms-endpoint
DEFAULT BRANCH: master
Ran 16 Apr 2025 05:36PM UTC
Jobs 2
Files 647
Run time 1min
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.978%. Remained the same
14498282071

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)

6135 of 9743 branches covered (62.97%)

23460 of 28971 relevant lines covered (80.98%)

1.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 14498282071.1 16 Apr 2025 05:36PM UTC 647
78.83
2 14498282071.2 16 Apr 2025 05:38PM UTC 647
80.96
Source Files on build 14498282071
  • Tree
  • List 647
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 1bbd0d6d on github
  • Prev Build on main (#14497468056)
  • Next Build on main (#14536942500)
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

© 2025 Coveralls, Inc