From 10f59f86334b12ccadbb97b684d892544d79d633 Mon Sep 17 00:00:00 2001 From: Clement Sam Date: Thu, 3 Nov 2022 08:18:40 +0000 Subject: [PATCH] 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 --- .../src/app/components/SNOContentFilling.vue | 2 +- web/storagenode/src/storagenode/sno/sno.ts | 4 ++-- .../unit/components/AllSatellitesAuditsArea.spec.ts | 4 ++-- .../AllSatellitesAuditsArea.spec.ts.snap | 4 ++-- web/storagenode/tests/unit/store/node.spec.ts | 12 ++++++------ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/web/storagenode/src/app/components/SNOContentFilling.vue b/web/storagenode/src/app/components/SNOContentFilling.vue index 213135828..f4751c670 100644 --- a/web/storagenode/src/app/components/SNOContentFilling.vue +++ b/web/storagenode/src/app/components/SNOContentFilling.vue @@ -129,7 +129,7 @@ { const satellites = new Satellites(); satellites.satellitesScores = [ new SatelliteScores('name1', 1, 1, 0.5), - new SatelliteScores('name2', 0.5, 1, 0.7), - new SatelliteScores('name3', 0.7, 1, 1), + new SatelliteScores('name2', 0.5, 1, 0.97), + new SatelliteScores('name3', 0.97, 1, 1), ]; jest.spyOn(nodeApi, 'satellites').mockReturnValue(Promise.resolve(satellites)); diff --git a/web/storagenode/tests/unit/components/__snapshots__/AllSatellitesAuditsArea.spec.ts.snap b/web/storagenode/tests/unit/components/__snapshots__/AllSatellitesAuditsArea.spec.ts.snap index 021d169a1..b32038fbd 100644 --- a/web/storagenode/tests/unit/components/__snapshots__/AllSatellitesAuditsArea.spec.ts.snap +++ b/web/storagenode/tests/unit/components/__snapshots__/AllSatellitesAuditsArea.spec.ts.snap @@ -38,7 +38,7 @@ exports[`AllSatellitesAuditsArea renders correctly with actual values 1`] = `

Online

-

70 %

+

97 %

@@ -53,7 +53,7 @@ exports[`AllSatellitesAuditsArea renders correctly with actual values 1`] = `

Audit

-

70 %

+

97 %

Online

diff --git a/web/storagenode/tests/unit/store/node.spec.ts b/web/storagenode/tests/unit/store/node.spec.ts index cd13f9ae4..7e5eed93e 100644 --- a/web/storagenode/tests/unit/store/node.spec.ts +++ b/web/storagenode/tests/unit/store/node.spec.ts @@ -102,15 +102,15 @@ describe('mutations', () => { it('selects all satellites', () => { const satelliteInfo = new Satellites(); satelliteInfo.satellitesScores = [ - new SatelliteScores('name1', 0.7, 0.9, 1), - new SatelliteScores('name1', 0.8, 0.8, 0.8), + new SatelliteScores('name1', 0.97, 0.97, 1), + new SatelliteScores('name1', 0.98, 0.98, 0.98), ]; store.commit(NODE_MUTATIONS.SELECT_ALL_SATELLITES, satelliteInfo); expect(state.node.selectedSatellite.id).toBe(''); expect(state.node.satellitesScores.length).toBe(satelliteInfo.satellitesScores.length); - expect(state.node.satellitesScores[0].auditScore.label).toBe('70 %'); + expect(state.node.satellitesScores[0].auditScore.label).toBe('97 %'); expect(state.node.satellitesScores[0].iconClassName).toBe('warning'); }); @@ -281,8 +281,8 @@ describe('actions', () => { it('success fetch all satellites info', async () => { const satellitesInfo = new Satellites(); satellitesInfo.satellitesScores = [ - new SatelliteScores('name1', 0.7, 0.9, 1), - new SatelliteScores('name1', 0.8, 0.8, 0.8), + new SatelliteScores('name1', 0.97, 0.9, 1), + new SatelliteScores('name1', 0.98, 0.98, 0.98), ]; jest.spyOn(nodeApi, 'satellites').mockReturnValue( @@ -295,7 +295,7 @@ describe('actions', () => { expect(state.node.satellitesScores.length).toBe(satellitesInfo.satellitesScores.length); expect(state.node.satellitesScores[0].onlineScore.label).toBe('100 %'); expect(state.node.satellitesScores[0].auditScore.statusClassName).toBe('warning'); - expect(state.node.satellitesScores[1].auditScore.label).toBe('80 %'); + expect(state.node.satellitesScores[1].auditScore.label).toBe('98 %'); }); });