summaryrefslogtreecommitdiffstats
path: root/toolkit/components/nimbus/test/unit/test_ExperimentAPI_NimbusFeatures.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/nimbus/test/unit/test_ExperimentAPI_NimbusFeatures.js')
-rw-r--r--toolkit/components/nimbus/test/unit/test_ExperimentAPI_NimbusFeatures.js28
1 files changed, 23 insertions, 5 deletions
diff --git a/toolkit/components/nimbus/test/unit/test_ExperimentAPI_NimbusFeatures.js b/toolkit/components/nimbus/test/unit/test_ExperimentAPI_NimbusFeatures.js
index 79304cd66e..9bbf26a6a0 100644
--- a/toolkit/components/nimbus/test/unit/test_ExperimentAPI_NimbusFeatures.js
+++ b/toolkit/components/nimbus/test/unit/test_ExperimentAPI_NimbusFeatures.js
@@ -92,8 +92,11 @@ add_task(async function readyCallAfterStore_with_remote_value() {
await manager.store.addEnrollment(MATCHING_ROLLOUT);
Assert.ok(!feature.getVariable("enabled"), "Loads value from store");
- manager.store._deleteForTests("aboutwelcome");
+
+ manager.unenroll(MATCHING_ROLLOUT.slug, "test-cleanup");
+
sandbox.restore();
+ await assertEmptyStore(manager.store);
});
add_task(async function has_sync_value_before_ready() {
@@ -121,7 +124,11 @@ add_task(async function has_sync_value_before_ready() {
Assert.equal(feature.getVariable("remoteValue"), true, "Sync load from pref");
- manager.store._deleteForTests("aboutwelcome");
+ Services.prefs.clearUserPref("nimbus.syncdefaultsstore.aboutwelcome");
+ Services.prefs.clearUserPref(
+ "nimbus.syncdefaultsstore.aboutwelcome.remoteValue"
+ );
+ await assertEmptyStore(manager.store);
});
add_task(async function update_remote_defaults_onUpdate() {
@@ -137,8 +144,10 @@ add_task(async function update_remote_defaults_onUpdate() {
Assert.equal(stub.callCount, 1, "Called once for remote configs");
Assert.equal(stub.firstCall.args[1], "rollout-updated", "Correct reason");
- manager.store._deleteForTests("aboutwelcome");
+ manager.unenroll(MATCHING_ROLLOUT.slug, "test-cleanup");
+
sandbox.restore();
+ await assertEmptyStore(manager.store);
});
add_task(async function test_features_over_feature() {
@@ -190,6 +199,9 @@ add_task(async function test_features_over_feature() {
manager.store._deleteForTests("aboutwelcome");
manager.store._deleteForTests("matching-rollout");
+
+ await assertEmptyStore(manager.store);
+
sandbox.restore();
});
@@ -208,7 +220,8 @@ add_task(async function update_remote_defaults_readyPromise() {
"Update called after enrollment processed."
);
- manager.store._deleteForTests("aboutwelcome");
+ manager.unenroll(MATCHING_ROLLOUT.slug, "test-cleanup");
+ await assertEmptyStore(manager.store);
sandbox.restore();
});
@@ -229,7 +242,8 @@ add_task(async function update_remote_defaults_enabled() {
"Feature is disabled by remote configuration"
);
- manager.store._deleteForTests("aboutwelcome");
+ manager.unenroll(NON_MATCHING_ROLLOUT.slug, "test-cleanup");
+ await assertEmptyStore(manager.store);
sandbox.restore();
});
@@ -252,6 +266,7 @@ add_task(async function test_getVariable_no_mutation() {
Assert.ok(feature.getVariable("mochitest"), "Got back the expected feature");
+ await assertEmptyStore(manager.store);
sandbox.restore();
});
@@ -284,4 +299,7 @@ add_task(async function remote_isEarlyStartup_config() {
Services.prefs.clearUserPref(
"nimbus.syncdefaultsstore.password-autocomplete"
);
+
+ manager.unenroll(rollout.slug, "test-cleanup");
+ await assertEmptyStore(manager.store);
});