Closed Bug 2018709 Opened 6 months ago Closed 1 month ago

Migrate Base 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 Base/BaseContent component tests, which test the top-level layout including prefs-driven conditional rendering, error state handling, and Redux store integration.

Updated tests:

  • test/unit/content-src/components/Base.test.jsx

Migrates Base.test.jsx from Enzyme/Karma to React Testing Library/Jest,
covering _Base, BaseContent, and WithDsAdmin.

  • Adds test/unit/jest/content-src/components/Base.test.jsx with 15 tests
  • Adds mocks to jest-setup.js: performance.getEntriesByType and
    ContentSearchHandoffUIController (Firefox browser globals)
  • Uses doNotFake: ["performance"] with jest.useFakeTimers to prevent
    @sinonjs/fake-timers from replacing the performance object
  • Marks test/unit/content-src/components/Base.test.jsx with
    @enzyme-to-rtl comment
Attachment #9547560 - Attachment is obsolete: true
Assignee: nobody → sdowne
Status: NEW → ASSIGNED
Attachment #9618905 - Attachment description: WIP: Bug 2018709 - Migrate Base unit test to Jest/RTL → WIP: Bug 2018709 - Migrate Base unit test to Jest/RTL. r?thecount
Attachment #9618905 - Attachment description: WIP: Bug 2018709 - Migrate Base unit test to Jest/RTL. r?thecount → WIP: Bug 2018709 - Migrate Base unit test to Jest/RTL. r=#home-newtab-reviewers
Attachment #9618905 - Attachment description: WIP: Bug 2018709 - Migrate Base unit test to Jest/RTL. r=#home-newtab-reviewers → Bug 2018709 - Migrate Base unit test to Jest/RTL. r=#home-newtab-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Blocks: 2062310
No longer blocks: 2018692
Attachment #9618710 - Attachment is obsolete: true
QA Whiteboard: [qa-triage-done-c156/b155]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: