Skip to content

Commit 853766e

Browse files
committed
Add paytest mode
1 parent 2383b82 commit 853766e

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/runtime/services-test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ describes.sandboxed('services', () => {
3838
expect(getSwgMode()).to.deep.equal(MODES.prod);
3939
});
4040

41+
it('should override with swg.mode=paytest', () => {
42+
self.location.hash = 'swg.mode=paytest';
43+
expect(getSwgMode()).to.deep.equal(MODES.paytest);
44+
});
45+
4146
it('should override with swg.mode=qual', () => {
4247
self.location.hash = 'swg.mode=qual';
4348
expect(getSwgMode()).to.deep.equal(MODES.qual);

src/runtime/services.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ interface OperatingMode {
4747
}
4848

4949
/**
50-
* Default operating Mode
50+
* Default operating mode.
5151
*/
5252
export const DEFAULT: OperatingMode = {
5353
frontEnd: FRONTEND,
@@ -57,7 +57,7 @@ export const DEFAULT: OperatingMode = {
5757
};
5858

5959
/**
60-
* Default operating Mode
60+
* Production operating mode.
6161
*/
6262
const PROD: OperatingMode = {
6363
frontEnd: 'https://news.google.com',
@@ -67,7 +67,15 @@ const PROD: OperatingMode = {
6767
};
6868

6969
/**
70-
* Default operating Mode
70+
* Production operating mode with test pay env.
71+
*/
72+
const PAY_TEST: OperatingMode = {
73+
...PROD,
74+
payEnv: 'TEST',
75+
};
76+
77+
/**
78+
* Autopush operating mode.
7179
*/
7280
const AUTOPUSH: OperatingMode = {
7381
frontEnd: 'https://subscribe-autopush.sandbox.google.com',
@@ -77,7 +85,7 @@ const AUTOPUSH: OperatingMode = {
7785
};
7886

7987
/**
80-
* Default operating Mode
88+
* Qual operating mode.
8189
*/
8290
const QUAL: OperatingMode = {
8391
frontEnd: 'https://subscribe-qual.sandbox.google.com',
@@ -95,6 +103,7 @@ const QUAL: OperatingMode = {
95103
export const MODES: {[key: string]: OperatingMode} = {
96104
'default': DEFAULT,
97105
'prod': PROD,
106+
'paytest': PAY_TEST,
98107
'autopush': AUTOPUSH,
99108
'qual': QUAL,
100109
};

0 commit comments

Comments
 (0)