Closed Bug 1881739 Opened 2 years ago Closed 1 year ago

Create a SearchTestUtils function to simplify creating configurations for tests

Categories

(Firefox :: Search, task, P3)

task

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: standard8, Assigned: mbeier)

References

Details

(Whiteboard: [sng])

Attachments

(1 file)

Once we start removing the old search configuration, we should investigate improving our facilities for creating search configurations for tests.

We have a lot of tests where we're fully specifying the configuration we want to use. As a lot of it is boiler plate, it would be nice to have a function that made it simpler, e.g. something like:

SearchTestUtils.createConfig([
  {
    variants: [
      {
        environment: { allRegionsAndLocales: true },
      },
    ],
  },
  {
    variants: [
      {
        environment: { regions: ["FR"] },
      },
    ],
  }
]);

This would create two engines, one that is available everywhere and one that is only available in the FR region. We might want to give them identifiers, so that we can easily reference them in the test code.

Another situation could be creating engines with particular search urls.

The main intent here is to allow boilerplate to be stripped away, and only specify what's needed for the test. This should make it easier to understand what the test is focussing on.

We might also replace SearchTestUtils.useTestEngines completely with this function.

Whiteboard: [sng]
Assignee: nobody → mbeier
Status: NEW → ASSIGNED
Pushed by mcheang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7866c5548885 Create a SearchTestUtils function to simplify creating configurations for tests. r=Standard8,mcheang,urlbar-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: