Closed Bug 2018705 Opened 7 months ago Closed 2 months ago

Migrate Sections unit test to Jest/RTL

Categories

(Firefox :: New Tab Page, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: maxx, Assigned: thecount)

References

Details

Attachments

(1 file, 2 obsolete files)

Migrate the Section component tests covering impression stats dispatching, visibility change events, and the sendNewTabRehydrated
flow (now using componentDidMount/componentDidUpdate after the React 19 lifecycle fixes).

Updated tests:

  • test/unit/content-src/components/Sections.test.jsx
Summary: Upgrade Sections to Jest/RTL → Migrate Sections unit test to Jest/RTL

Migrates Sections.test.jsx from Enzyme/Karma to React Testing Library/Jest,
covering _Sections and Section.

  • Adds test/unit/jest/content-src/components/Sections.test.jsx with 25 tests
  • Tests use data-section-id attribute for section ordering assertions
  • Replaces sinon.spy/stub with jest.fn() and wrapper.setProps with rerender
  • Replaces instance().numRows checks with observable card count assertions
  • Marks test/unit/content-src/components/Sections.test.jsx with
    @enzyme-to-rtl comment
Attachment #9547561 - Attachment is obsolete: true
Assignee: nobody → sdowne
Status: NEW → ASSIGNED
Attachment #9618738 - Attachment description: WIP: Bug 2018705 - Migrate Sections unit test to Jest/RTL → WIP: Bug 2018705 - Migrate Sections unit test to Jest/RTL. r?thecount
Attachment #9618738 - Attachment description: WIP: Bug 2018705 - Migrate Sections unit test to Jest/RTL. r?thecount → WIP: Bug 2018705 - Migrate Sections unit test to Jest/RTL. r=#home-newtab-reviewers
Attachment #9618738 - Attachment description: WIP: Bug 2018705 - Migrate Sections unit test to Jest/RTL. r=#home-newtab-reviewers → Bug 2018705 - Migrate Sections unit test to Jest/RTL. r=#home-newtab-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Blocks: 2062310
No longer blocks: 2018692
QA Whiteboard: [qa-triage-done-c156/b155]
Attachment #9618708 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: