Skip to content

Commit

Permalink
add mathstream browser mock (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
danoswaltCL authored Jun 20, 2023
1 parent 63ab532 commit 08d6366
Show file tree
Hide file tree
Showing 8 changed files with 359 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ export const availableFrontendMockApps = [
MOCK_APP_NAMES.GENERAL_TS_FRONTEND_5_0,
// MOCK_APP_NAMES.BDAY_APP,
MOCK_APP_NAMES.PORTAL_APP,
MOCK_APP_NAMES.MATHSTREAM_AdaptiveSegmentSwapExperiment,
];
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ export class GeneralTestForVersion1Service extends AbstractMockAppService {
public TYPE: MockAppType = 'frontend';
public LANGUAGE: CodeLanguage = 'ts';
public SITES = {
TEST: 'test',
SelectSection: 'SelectSection',
};
public TARGETS = {
TARGET_1: 'target_1',
TARGET_2: 'target_2',
TARGET_1: 'absolute_value_plot_equality',
};
public GROUPS = ['schoolId', 'classId', 'instructorId'];
public CONTEXT = 'add'; // what should this be really?
public CONTEXT = 'assign-prog'; // what should this be really?
public HOOKNAMES = {
INIT: 'init',
ASSIGN: 'assign',
Expand All @@ -50,8 +49,7 @@ export class GeneralTestForVersion1Service extends AbstractMockAppService {
LOG: 'log',
};
public DECISION_POINTS = [
{ site: this.SITES.TEST, target: this.TARGETS.TARGET_1 },
{ site: this.SITES.TEST, target: this.TARGETS.TARGET_2 },
{ site: this.SITES.SelectSection, target: this.TARGETS.TARGET_1 },
];

constructor(public override clientLibraryService: ClientLibraryService, public override eventBus: EventBusService) {
Expand Down Expand Up @@ -191,7 +189,7 @@ export class GeneralTestForVersion1Service extends AbstractMockAppService {
console.error('No upgradeClient found. Maybe you need to run login hook first?');
}
try {
const markResponse = await this.upgradeClient.markExperimentPoint(this.SITES.TEST, 'control');
const markResponse = await this.upgradeClient.markExperimentPoint(this.SITES.SelectSection, 'asdf=orange; fdfasdfs=green', this.TARGETS.TARGET_1);
console.log({ markResponse });
} catch (err) {
console.error(err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ export class GeneralTestForVersion3Service extends AbstractMockAppService {
public TYPE: MockAppType = 'frontend';
public LANGUAGE: CodeLanguage = 'ts';
public SITES = {
TEST: 'test',
SelectSection: 'SelectSection',
};
public TARGETS = {
TARGET_1: 'target_1',
TARGET_2: 'target_2',
TARGET_1: 'absolute_value_plot_equality',
};
public GROUPS = ['schoolId', 'classId', 'instructorId'];
public CONTEXT = 'add'; // what should this be really?
public CONTEXT = 'assign-prog'; // what should this be really?
public HOOKNAMES = {
INIT: 'init',
ASSIGN: 'assign',
Expand All @@ -57,8 +56,7 @@ export class GeneralTestForVersion3Service extends AbstractMockAppService {
LOG: 'log',
};
public DECISION_POINTS = [
{ site: this.SITES.TEST, target: this.TARGETS.TARGET_1 },
{ site: this.SITES.TEST, target: this.TARGETS.TARGET_2 },
{ site: this.SITES.SelectSection, target: this.TARGETS.TARGET_1 },
];

constructor(public override clientLibraryService: ClientLibraryService, public override eventBus: EventBusService) {
Expand Down Expand Up @@ -199,8 +197,8 @@ export class GeneralTestForVersion3Service extends AbstractMockAppService {
}
try {
const markResponse = await this.upgradeClient.markExperimentPoint(
this.SITES.TEST,
'control', // mock apps may need conditions
this.SITES.SelectSection,
'asdf=orange; fdfasdfs=green', // mock apps may need conditions
MARKED_DECISION_POINT_STATUS.CONDITION_APPLIED,
this.TARGETS.TARGET_1
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ export class GeneralTestForVersion41Service extends AbstractMockAppService {
public TYPE: MockAppType = 'frontend';
public LANGUAGE: CodeLanguage = 'ts';
public SITES = {
TEST: 'test',
SelectSection: 'SelectSection',
};
public TARGETS = {
TARGET_1: 'target_1',
TARGET_2: 'target_2',
TARGET_1: 'absolute_value_plot_equality',
};
public GROUPS = ['schoolId', 'classId', 'instructorId'];
public CONTEXT = 'add'; // what should this be really?
public CONTEXT = 'assign-prog'; // what should this be really?
public HOOKNAMES = {
INIT: 'init',
ASSIGN: 'assign',
Expand All @@ -55,11 +54,10 @@ export class GeneralTestForVersion41Service extends AbstractMockAppService {
WORKING_GROUPS: 'update_working_group',
SET_ALT_USER_IDS: 'setAltUserIds',
LOG: 'log',
LOG_CALIPER: 'log_caliper',
LOG_CALIPER: 'logCaliper'
};
public DECISION_POINTS = [
{ site: this.SITES.TEST, target: this.TARGETS.TARGET_1 },
{ site: this.SITES.TEST, target: this.TARGETS.TARGET_2 },
{ site: this.SITES.SelectSection, target: this.TARGETS.TARGET_1 },
];

constructor(public override clientLibraryService: ClientLibraryService, public override eventBus: EventBusService) {
Expand Down Expand Up @@ -210,7 +208,7 @@ export class GeneralTestForVersion41Service extends AbstractMockAppService {
}
try {
const markResponse = await this.upgradeClient.markExperimentPoint(
this.SITES.TEST,
this.SITES.SelectSection,
'control', // mock apps may need conditions
MARKED_DECISION_POINT_STATUS.CONDITION_APPLIED,
this.TARGETS.TARGET_1
Expand Down
Loading

0 comments on commit 08d6366

Please sign in to comment.