storj/web/multinode/tests/unit/mock/store.ts

48 lines
1.7 KiB
TypeScript
Raw Normal View History

// Copyright (C) 2021 Storj Labs, Inc.
// See LICENSE for copying information.
import Vuex from 'vuex';
import { BandwidthClient } from '@/api/bandwidth';
import { NodesClient } from '@/api/nodes';
import { Operators as OperatorsClient } from '@/api/operators';
import { PayoutsClient } from '@/api/payouts';
import { BandwidthModule } from '@/app/store/bandwidth';
import { NodesModule } from '@/app/store/nodes';
import { OperatorsModule } from '@/app/store/operators';
import { PayoutsModule } from '@/app/store/payouts';
import { Bandwidth } from '@/bandwidth/service';
import { Nodes } from '@/nodes/service';
import { Operators } from '@/operators';
import { Payouts } from '@/payouts/service';
import { createLocalVue } from '@vue/test-utils';
const Vue = createLocalVue();
Vue.use(Vuex);
const nodesClient: NodesClient = new NodesClient();
export const nodesService: Nodes = new Nodes(nodesClient);
const nodesModule: NodesModule = new NodesModule(nodesService);
const payoutsClient: PayoutsClient = new PayoutsClient();
export const payoutsService: Payouts = new Payouts(payoutsClient);
const payoutsModule: PayoutsModule = new PayoutsModule(payoutsService);
const bandwidthClient = new BandwidthClient();
export const bandwidthService = new Bandwidth(bandwidthClient);
const bandwidthModule: BandwidthModule = new BandwidthModule(bandwidthService);
const operatorsClient: OperatorsClient = new OperatorsClient();
export const operatorsService: Operators = new Operators(operatorsClient);
const operatorsModule: OperatorsModule = new OperatorsModule(operatorsService);
const store = new Vuex.Store({ modules: {
payouts: payoutsModule,
nodes: nodesModule,
operators: operatorsModule,
bandwidth: bandwidthModule,
}});
export default store;