Skip to content

feat: Add findItemById test-util to FlashbarWrapper#4367

Draft
johannes-weber wants to merge 1 commit intomainfrom
jowejowe/flashbar-find-item-by-id
Draft

feat: Add findItemById test-util to FlashbarWrapper#4367
johannes-weber wants to merge 1 commit intomainfrom
jowejowe/flashbar-find-item-by-id

Conversation

@johannes-weber
Copy link
Member

@johannes-weber johannes-weber commented Mar 20, 2026

Description

Add findItemById(id) method to FlashbarWrapper test utility, allowing users to target individual flash items by their id property during testing.

This is useful for console flows with multiple sequential API calls that each generate separate flash notifications (e.g., create resource → configure settings). Tests can now assert on specific flashes by ID instead of relying on positional indexing.

The method reuses the existing data-itemid attribute already rendered on flash items — no changes to the Flashbar component source.

Related links, issue #, if available: AWSUI-61831

How has this been tested?

Unit tests (non-collapsible and collapsible flashbar), integration test.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.45%. Comparing base (6082b18) to head (116c6e3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4367   +/-   ##
=======================================
  Coverage   97.45%   97.45%           
=======================================
  Files         902      902           
  Lines       26468    26471    +3     
  Branches     9539     9541    +2     
=======================================
+ Hits        25794    25797    +3     
+ Misses        668      631   -37     
- Partials        6       43   +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant