storj/web/storagenode/tests/unit/components/AllSatellitesAuditsArea.spec.ts
Clement Sam 10f59f8633 web/storagenode: update new suspension and audit threshold on dashboard
The new audit scoring sets disqualification threshold to <96:
https://forum.storj.io/t/new-audit-scoring-is-live/19466/24.

This changes applies this update to the dashboard,
same colors but different thresholds now:
<96 = disqualification
<99 = warning

previously:
<60 = disqualification
<95 = warning

Closes https://github.com/storj/storj/issues/5113

Change-Id: Iaf61e5034101fe5d4d70df6b72eb5f4ccb706e5b
2022-11-04 17:47:05 +00:00

45 lines
1.5 KiB
TypeScript

// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
import Vuex from 'vuex';
import AllSatellitesAuditsArea from '@/app/components/AllSatellitesAuditsArea.vue';
import { newNodeModule, NODE_ACTIONS } from '@/app/store/modules/node';
import { StorageNodeApi } from '@/storagenode/api/storagenode';
import { StorageNodeService } from '@/storagenode/sno/service';
import { Satellites, SatelliteScores } from '@/storagenode/sno/sno';
import { createLocalVue, shallowMount } from '@vue/test-utils';
const localVue = createLocalVue();
localVue.use(Vuex);
const nodeApi = new StorageNodeApi();
const nodeService = new StorageNodeService(nodeApi);
const nodeModule = newNodeModule(nodeService);
const store = new Vuex.Store({ modules: { node: nodeModule }});
describe('AllSatellitesAuditsArea', (): void => {
it('renders correctly with actual values', async (): Promise<void> => {
const wrapper = shallowMount(AllSatellitesAuditsArea, {
store,
localVue,
});
const satellites = new Satellites();
satellites.satellitesScores = [
new SatelliteScores('name1', 1, 1, 0.5),
new SatelliteScores('name2', 0.5, 1, 0.97),
new SatelliteScores('name3', 0.97, 1, 1),
];
jest.spyOn(nodeApi, 'satellites').mockReturnValue(Promise.resolve(satellites));
await store.dispatch(NODE_ACTIONS.SELECT_SATELLITE);
expect(wrapper).toMatchSnapshot();
});
});