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

kobotoolbox / kpi / 18339084846
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-1257-remove-v1-forms-endpoint
DEFAULT BRANCH: master
Ran 08 Oct 2025 09:22AM UTC
Jobs 2
Files 864
Run time 2min
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

08 Oct 2025 08:46AM UTC coverage: 81.206%. Remained the same
18339084846

push

github

web-flow
test(storybook): DeleteAccountBanner DEV-1117 (#6338)

### 💭 Notes

Changes:
- Moved `meMock` and `environmentMock` to be globally defined for all
stories
- Created `TestIdSessionDecorator` that reads `args.storybookTestId` of
given story and stores it in sessionStorage making it accessible for MSW
mocks
- `DeleteAccountBanner.stories.tsx` now has two more stories: User Has
Assets, and User Owns MMO
- `DeleteAccountBanner.tsx` no longer needs test code to be present
- `assets.mocks.ts` and `organization.mocks.ts` use `storybookTestId`
from `sessionStorage` to serve custom responses
- Bumped `msw` and `msw-storybook-addon` versions while debugging this,
hoping it would solve an issue I had with msw returning 404s for
existing mocks. The problem solved by itself :shrug: but this doesn't
break anything so I left it here.

The problem was caused by mocks not returning proper customized
responses for non-default cases. I redid the way we handle those and was
able to do it in such a way that we no longer need to adjust original
components.

**Unfortunately** the solution above will not work for "Docs" view (the
one with all stories for given component), as MSW loads all these
stories in same iframe/window. Meaning that the last defined MSW mock
will take priority.

So if one story returns a different response for `/assets` endpoint, it
will work when viewed separately (and AFAIK in Chromatic, as it doesn't
care about "Docs" view), but in "Docs" view, all `/assets` calls will
return identical response (the last defined mock).

This is a known limitation as I learned and I haven't found a nice
solution. The one that would work would require us having parameters
being passed to components (and then further to queries and all places
that make the API call) so that finally it will end up added as search
query. The only way for MSW mock to return different response
(regardless of being rendered alone or among other stories) is to have
the URL being different. I a... (continued)

7004 of 11024 branches covered (63.53%)

26919 of 33149 relevant lines covered (81.21%)

1.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 18339084846.1 08 Oct 2025 09:22AM UTC 862
78.76
2 18339084846.2 08 Oct 2025 09:23AM UTC 864
81.19
Source Files on build 18339084846
  • Tree
  • List 864
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • a5c7776a on github
  • Prev Build on main (#18328263854)
  • Next Build on main (#18350981242)
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