Closed Bug 2018708 Opened 8 months ago Closed 1 month ago

Migrate TopSites unit tests to Jest/RTL

Categories

(Firefox :: New Tab Page, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: maxx, Assigned: thecount)

References

Details

Attachments

(1 external file, 2 obsolete files)

Migrate the large TopSites container test suite covering drag-and-drop interactions, keyboard navigation, Redux state changes, and
sponsored/search shortcut top site behaviors.

Updated tests:

  • test/unit/content-src/components/TopSites.test.jsx
  • test/unit/content-src/components/TopSites/SearchShortcutsForm.test.jsx
  • test/unit/content-src/components/TopSites/TopSiteImpressionWrapper.test.jsx

Migrates TopSites.test.jsx, SearchShortcutsForm.test.jsx, and
TopSiteImpressionWrapper.test.jsx from Enzyme/Karma to React Testing
Library/Jest.

  • Adds test/unit/jest/content-src/components/TopSites.test.jsx with 53 tests
    covering TopSites, TopSiteLink, TopSite, TopSiteForm, TopSiteFormInput,
    TopSiteList, and TopSiteAddButton
  • Adds test/unit/jest/content-src/components/TopSites/SearchShortcutsForm.test.jsx
    with 3 tests
  • Adds test/unit/jest/content-src/components/TopSites/TopSiteImpressionWrapper.test.jsx
    with 6 tests
  • Uses Redux Provider with createStore for components with connected children
  • Replaces wrapper.instance() calls for internal methods (_allowDrop,
    onDragEvent, validateUrl, etc.) with observable DOM assertions; drag-and-drop
    and keyboard navigation tests are omitted as implementation details
  • Marks all three Enzyme files with @enzyme-to-rtl comments
Attachment #9547562 - Attachment is obsolete: true
Assignee: nobody → sdowne
Status: NEW → ASSIGNED
Attachment #9618903 - Attachment description: WIP: Bug 2018708 - Migrate TopSites unit tests to Jest/RTL → WIP: Bug 2018708 - Migrate TopSites unit tests to Jest/RTL. r?thecount
Attachment #9618903 - Attachment description: WIP: Bug 2018708 - Migrate TopSites unit tests to Jest/RTL. r?thecount → WIP: Bug 2018708 - Migrate TopSites unit tests to Jest/RTL. r=#home-newtab-reviewers
Attachment #9618903 - Attachment description: WIP: Bug 2018708 - Migrate TopSites unit tests to Jest/RTL. r=#home-newtab-reviewers → Bug 2018708 - Migrate TopSites unit tests to Jest/RTL. r=#home-newtab-reviewers
Attachment #9618709 - Attachment is obsolete: true
Blocks: 2062310
No longer blocks: 2018692
Attachment #9618903 - Attachment description: Bug 2018708 - Migrate TopSites unit tests to Jest/RTL. r=#home-newtab-reviewers → Bug 2018708 - Migrate TopSites unit tests to Jest/RTL. r?reemhamz
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
QA Whiteboard: [qa-triage-done-c159/b158]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: