Skip to content

Commit 182526a

Browse files
committed
test: promotions integ tests seperate test cred storage
1 parent 1fc6355 commit 182526a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/phoenix/trust_ring.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ function _selectKeys() {
178178
return generateRandomKeyAndIV();
179179
}
180180

181-
const CRED_KEY_API = "API_KEY";
182-
const CRED_KEY_PROMO = "PROMO_GRANT_KEY";
183-
const SIGNATURE_SALT_KEY = "SIGNATURE_SALT_KEY";
181+
const CRED_KEY_API = Phoenix.isTestWindow ? "API_KEY_TEST" : "API_KEY";
182+
const CRED_KEY_PROMO = Phoenix.isTestWindow ? "PROMO_GRANT_KEY_TEST" : "PROMO_GRANT_KEY";
183+
const SIGNATURE_SALT_KEY = Phoenix.isTestWindow ? "SIGNATURE_SALT_KEY_TEST" : "SIGNATURE_SALT_KEY";
184184
const { key, iv } = _selectKeys();
185185
// this key is set at boot time as a truct base for all the core components before any extensions are loaded.
186186
// just before extensions are loaded, this key is blanked. This can be used by core modules to talk with other

src/services/promotions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ define(function (require, exports, module) {
4646

4747
// Constants
4848
const EVENT_PRO_UPGRADE_ON_INSTALL = "pro_upgrade_on_install";
49-
const PROMO_LOCAL_FILE = path.join(Phoenix.app.getApplicationSupportDirectory(), "entitlements_promo.json");
49+
const PROMO_LOCAL_FILE = path.join(Phoenix.app.getApplicationSupportDirectory(),
50+
Phoenix.isTestWindow ? "entitlements_promo_test.json" : "entitlements_promo.json");
5051
const TRIAL_POLL_MS = 10 * 1000; // 10 seconds after start, we assign a free trial if possible
5152
const FIRST_INSTALL_TRIAL_DAYS = 30;
5253
const SUBSEQUENT_TRIAL_DAYS = 7;

0 commit comments

Comments
 (0)