Skip to content

Commit

Permalink
[Testbed utils] Readme + chrome extension (#35724)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga authored May 7, 2019
1 parent 7711b65 commit 12b93bc
Show file tree
Hide file tree
Showing 27 changed files with 798 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { AutoFollowPatternAdd } from '../../../public/app/sections/auto_follow_p
import { ccrStore } from '../../../public/app/store';
import routing from '../../../public/app/services/routing';

const testBedOptions = {
const testBedConfig = {
store: ccrStore,
memoryRouter: {
onRouter: (router) => routing.reactRouter = router
}
};

const initTestBed = registerTestBed(AutoFollowPatternAdd, { options: testBedOptions, store: ccrStore });
const initTestBed = registerTestBed(AutoFollowPatternAdd, testBedConfig);

export const setup = (props) => {
const testBed = initTestBed(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import routing from '../../../public/app/services/routing';

import { AUTO_FOLLOW_PATTERN_EDIT_NAME } from './constants';

const testBedOptions = {
const testBedConfig = {
store: ccrStore,
memoryRouter: {
onRouter: (router) => routing.reactRouter = router,
// The auto-follow pattern id to fetch is read from the router ":id" param
Expand All @@ -22,7 +23,7 @@ const testBedOptions = {
}
};

const initTestBed = registerTestBed(AutoFollowPatternEdit, { options: testBedOptions, store: ccrStore });
const initTestBed = registerTestBed(AutoFollowPatternEdit, testBedConfig);

export const setup = (props) => {
const testBed = initTestBed(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { AutoFollowPatternList } from '../../../public/app/sections/home/auto_fo
import { ccrStore } from '../../../public/app/store';
import routing from '../../../public/app/services/routing';

const testBedOptions = {
const testBedConfig = {
store: ccrStore,
memoryRouter: {
onRouter: (router) => routing.reactRouter = router
}
};

const initTestBed = registerTestBed(AutoFollowPatternList, { options: testBedOptions, store: ccrStore });
const initTestBed = registerTestBed(AutoFollowPatternList, testBedConfig);

export const setup = (props) => {
const testBed = initTestBed(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { FollowerIndexAdd } from '../../../public/app/sections/follower_index_ad
import { ccrStore } from '../../../public/app/store';
import routing from '../../../public/app/services/routing';

const testBedOptions = {
const testBedConfig = {
store: ccrStore,
memoryRouter: {
onRouter: (router) => routing.reactRouter = router
}
};

const initTestBed = registerTestBed(FollowerIndexAdd, { options: testBedOptions, store: ccrStore });
const initTestBed = registerTestBed(FollowerIndexAdd, testBedConfig);

export const setup = (props) => {
const testBed = initTestBed(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import routing from '../../../public/app/services/routing';

import { FOLLOWER_INDEX_EDIT_NAME } from './constants';

const testBedOptions = {
const testBedConfig = {
store: ccrStore,
memoryRouter: {
onRouter: (router) => routing.reactRouter = router,
// The follower index id to fetch is read from the router ":id" param
Expand All @@ -22,7 +23,7 @@ const testBedOptions = {
}
};

const initTestBed = registerTestBed(FollowerIndexEdit, { options: testBedOptions, store: ccrStore });
const initTestBed = registerTestBed(FollowerIndexEdit, testBedConfig);

export const setup = (props) => {
const testBed = initTestBed(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { FollowerIndicesList } from '../../../public/app/sections/home/follower_
import { ccrStore } from '../../../public/app/store';
import routing from '../../../public/app/services/routing';

const testBedOptions = {
const testBedConfig = {
store: ccrStore,
memoryRouter: {
onRouter: (router) => routing.reactRouter = router
}
};

const initTestBed = registerTestBed(FollowerIndicesList, { options: testBedOptions, store: ccrStore });
const initTestBed = registerTestBed(FollowerIndicesList, testBedConfig);

export const setup = (props) => {
const testBed = initTestBed(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import { ccrStore } from '../../../public/app/store';
import routing from '../../../public/app/services/routing';
import { BASE_PATH } from '../../../common/constants';

const testBedOptions = {
const testBedConfig = {
store: ccrStore,
memoryRouter: {
initialEntries: [`${BASE_PATH}/follower_indices`],
componentRoutePath: `${BASE_PATH}/:section`,
onRouter: (router) => routing.reactRouter = router
}
};

export const setup = registerTestBed(CrossClusterReplicationHome, { options: testBedOptions, store: ccrStore });
export const setup = registerTestBed(CrossClusterReplicationHome, testBedConfig);
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { RemoteClusterAdd } from '../../../public/sections/remote_cluster_add';
import { createRemoteClustersStore } from '../../../public/store';
import { registerRouter } from '../../../public/services/routing';

const testBedOptions = {
const testBedConfig = {
store: createRemoteClustersStore,
memoryRouter: {
onRouter: (router) => registerRouter(router)
}
};

const initTestBed = registerTestBed(RemoteClusterAdd, { options: testBedOptions, store: createRemoteClustersStore });
const initTestBed = registerTestBed(RemoteClusterAdd, testBedConfig);

export const setup = (props) => {
const testBed = initTestBed(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { registerRouter } from '../../../public/services/routing';

import { REMOTE_CLUSTER_EDIT_NAME } from './constants';

const testBedOptions = {
const testBedConfig = {
store: createRemoteClustersStore,
memoryRouter: {
onRouter: (router) => registerRouter(router),
// The remote cluster name to edit is read from the router ":id" param
Expand All @@ -22,4 +23,4 @@ const testBedOptions = {
}
};

export const setup = registerTestBed(RemoteClusterEdit, { options: testBedOptions, store: createRemoteClustersStore });
export const setup = registerTestBed(RemoteClusterEdit, testBedConfig);
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { RemoteClusterList } from '../../../public/sections/remote_cluster_list'
import { createRemoteClustersStore } from '../../../public/store';
import { registerRouter } from '../../../public/services/routing';

const testBedOptions = {
const testBedConfig = {
store: createRemoteClustersStore,
memoryRouter: {
onRouter: (router) => registerRouter(router)
}
};

const initTestBed = registerTestBed(RemoteClusterList, { options: testBedOptions, store: createRemoteClustersStore });
const initTestBed = registerTestBed(RemoteClusterList, testBedConfig);

export const setup = (props) => {
const testBed = initTestBed(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { registerRouter } from '../../../public/crud_app/services';
import { createRollupJobsStore } from '../../../public/crud_app/store';
import { JobList } from '../../../public/crud_app/sections/job_list';

const testBedOptions = {
const testBedConfig = {
store: createRollupJobsStore,
memoryRouter: {
onRouter: (router) => {
// register our react memory router
Expand All @@ -19,4 +20,4 @@ const testBedOptions = {
}
};

export const setup = registerTestBed(JobList, { options: testBedOptions, store: createRollupJobsStore });
export const setup = registerTestBed(JobList, testBedConfig);
Loading

0 comments on commit 12b93bc

Please sign in to comment.