Skip to content

feat: Add findItemById test-util to FlashbarWrapper#4367

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

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
Copy Markdown
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
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.44%. Comparing base (00b00b5) to head (1074351).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4367   +/-   ##
=======================================
  Coverage   97.44%   97.44%           
=======================================
  Files         902      902           
  Lines       26488    26491    +3     
  Branches     9554     9554           
=======================================
+ Hits        25810    25813    +3     
- Misses        635      672   +37     
+ Partials       43        6   -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.

@johannes-weber johannes-weber force-pushed the jowejowe/flashbar-find-item-by-id branch 2 times, most recently from c5ade7e to 5e98e74 Compare March 25, 2026 16:10
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.

2 participants