Bug 1959483 - Port tests from ExperimentFakes and ExperimentTestUtils to NimbusTestUtils in browser/components/genai r=nimbus-reviewers,firefox-ai-ml-reviewers,beth,Mardak
Differential Revision: https://phabricator.services.mozilla.com/D247008
This commit is contained in:
committed by
dthorn@mozilla.com
parent
221b7f2e3b
commit
5a6f848c38
@@ -1,7 +1,7 @@
|
|||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
const { ExperimentFakes } = ChromeUtils.importESModule(
|
const { NimbusTestUtils } = ChromeUtils.importESModule(
|
||||||
"resource://testing-common/NimbusTestUtils.sys.mjs"
|
"resource://testing-common/NimbusTestUtils.sys.mjs"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ add_task(async function test_nimbus_user_prefs() {
|
|||||||
"No user nimbus pref yet"
|
"No user nimbus pref yet"
|
||||||
);
|
);
|
||||||
|
|
||||||
let cleanup = await ExperimentFakes.enrollWithFeatureConfig({
|
let cleanup = await NimbusTestUtils.enrollWithFeatureConfig({
|
||||||
featureId: "chatbot",
|
featureId: "chatbot",
|
||||||
value: {
|
value: {
|
||||||
prefs: {
|
prefs: {
|
||||||
@@ -54,7 +54,7 @@ add_task(async function test_nimbus_user_prefs() {
|
|||||||
"sidebar used default value"
|
"sidebar used default value"
|
||||||
);
|
);
|
||||||
|
|
||||||
cleanup = await ExperimentFakes.enrollWithFeatureConfig({
|
cleanup = await NimbusTestUtils.enrollWithFeatureConfig({
|
||||||
featureId: "chatbot",
|
featureId: "chatbot",
|
||||||
value: {
|
value: {
|
||||||
prefs: {
|
prefs: {
|
||||||
@@ -92,7 +92,7 @@ add_task(async function test_nimbus_default_prefs() {
|
|||||||
"sidebar used default value"
|
"sidebar used default value"
|
||||||
);
|
);
|
||||||
|
|
||||||
const cleanup = await ExperimentFakes.enrollWithFeatureConfig({
|
const cleanup = await NimbusTestUtils.enrollWithFeatureConfig({
|
||||||
featureId: "chatbot",
|
featureId: "chatbot",
|
||||||
value: {
|
value: {
|
||||||
prefs: {
|
prefs: {
|
||||||
@@ -118,7 +118,7 @@ add_task(async function test_nimbus_default_prefs() {
|
|||||||
add_task(async function test_nimbus_rollout_experiment() {
|
add_task(async function test_nimbus_rollout_experiment() {
|
||||||
const foo = "browser.ml.chat.foo";
|
const foo = "browser.ml.chat.foo";
|
||||||
const nimbus = "browser.ml.chat.nimbus";
|
const nimbus = "browser.ml.chat.nimbus";
|
||||||
const cleanRollout = await ExperimentFakes.enrollWithFeatureConfig(
|
const cleanRollout = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: "chatbot",
|
featureId: "chatbot",
|
||||||
value: {
|
value: {
|
||||||
@@ -138,7 +138,7 @@ add_task(async function test_nimbus_rollout_experiment() {
|
|||||||
const nimbusValue = Services.prefs.getStringPref(nimbus);
|
const nimbusValue = Services.prefs.getStringPref(nimbus);
|
||||||
Assert.ok(nimbusValue, "Set some nimbus slug");
|
Assert.ok(nimbusValue, "Set some nimbus slug");
|
||||||
|
|
||||||
const cleanExperiment = await ExperimentFakes.enrollWithFeatureConfig({
|
const cleanExperiment = await NimbusTestUtils.enrollWithFeatureConfig({
|
||||||
featureId: "chatbot",
|
featureId: "chatbot",
|
||||||
value: {
|
value: {
|
||||||
prefs: {
|
prefs: {
|
||||||
@@ -170,7 +170,7 @@ add_task(async function test_nimbus_rollout_experiment() {
|
|||||||
add_task(async function test_nimbus_minimum_version() {
|
add_task(async function test_nimbus_minimum_version() {
|
||||||
const foo = "browser.ml.chat.foo";
|
const foo = "browser.ml.chat.foo";
|
||||||
const nimbus = "browser.ml.chat.nimbus";
|
const nimbus = "browser.ml.chat.nimbus";
|
||||||
let cleanup = await ExperimentFakes.enrollWithFeatureConfig({
|
let cleanup = await NimbusTestUtils.enrollWithFeatureConfig({
|
||||||
featureId: "chatbot",
|
featureId: "chatbot",
|
||||||
value: {
|
value: {
|
||||||
minVersion: AppConstants.MOZ_APP_VERSION_DISPLAY + ".1",
|
minVersion: AppConstants.MOZ_APP_VERSION_DISPLAY + ".1",
|
||||||
@@ -188,7 +188,7 @@ add_task(async function test_nimbus_minimum_version() {
|
|||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
cleanup = await ExperimentFakes.enrollWithFeatureConfig({
|
cleanup = await NimbusTestUtils.enrollWithFeatureConfig({
|
||||||
featureId: "chatbot",
|
featureId: "chatbot",
|
||||||
value: {
|
value: {
|
||||||
minVersion: AppConstants.MOZ_APP_VERSION_DISPLAY,
|
minVersion: AppConstants.MOZ_APP_VERSION_DISPLAY,
|
||||||
|
|||||||
Reference in New Issue
Block a user