From e7ed8bf16071499c7d0ace7384f705b3736b3c8a Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Mon, 27 Mar 2023 19:35:40 -0400 Subject: [PATCH 1/2] ensure role does not container the so- prefix --- html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/index.html b/html/index.html index 9f1c29d8..5095be2a 100644 --- a/html/index.html +++ b/html/index.html @@ -2975,7 +2975,7 @@

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

fa-chart-line - + fa-file-import From 989821cef80ddd9aa6964709f043dd37456787d6 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Mon, 27 Mar 2023 19:40:59 -0400 Subject: [PATCH 2/2] 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 5095be2a..9f1c29d8 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 2e61559b..e1a4b44a 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 af0c4c2b..3e6c0a18 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