From 989821cef80ddd9aa6964709f043dd37456787d6 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Mon, 27 Mar 2023 19:40:59 -0400 Subject: [PATCH] move logic to allow for testing --- html/index.html | 2 +- html/js/routes/grid.js | 2 +- html/js/routes/grid.test.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/html/index.html b/html/index.html index 5095be2ad..9f1c29d80 100644 --- a/html/index.html +++ b/html/index.html @@ -2975,7 +2975,7 @@

{{ i18n.gridEps }} {{ gridEps | formatCount }}

fa-chart-line - + fa-file-import diff --git a/html/js/routes/grid.js b/html/js/routes/grid.js index 2e61559b6..e1a4b44a0 100644 --- a/html/js/routes/grid.js +++ b/html/js/routes/grid.js @@ -158,7 +158,7 @@ routes.push({ path: '/grid', name: 'grid', component: { return false; }, async gridMemberTest() { - const nodeId = this.hideTestConfirm(); + const nodeId = this.hideTestConfirm().replace('_so-', '_'); this.$root.startLoading(); try { await this.$root.papi.post('gridmembers/' + nodeId + "/test"); diff --git a/html/js/routes/grid.test.js b/html/js/routes/grid.test.js index af0c4c2bd..3e6c0a182 100644 --- a/html/js/routes/grid.test.js +++ b/html/js/routes/grid.test.js @@ -109,7 +109,7 @@ test('canTest', () => { test('gridMemberTest', async () => { resetPapi(); const mock = mockPapi("post"); - comp.selectedId = '123'; + comp.selectedId = 'fwd01_so-sensor'; await comp.gridMemberTest(); - expect(mock).toHaveBeenCalledWith('gridmembers/123/test'); + expect(mock).toHaveBeenCalledWith('gridmembers/fwd01_sensor/test'); }); \ No newline at end of file