Skip to content

Commit

Permalink
move logic to allow for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jertel committed Mar 27, 2023
1 parent e7ed8bf commit 989821c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2975,7 +2975,7 @@ <h4 v-if="metricsEnabled">{{ i18n.gridEps }} {{ gridEps | formatCount }}</h4>
<v-icon>fa-chart-line</v-icon>
</v-btn>
</a>
<v-btn v-if="canTest(item)" id="test-minion" icon :title="i18n.nodeTest" @click="showTestConfirm(item.id + '_' + item.role.replace('so-', ''))">
<v-btn v-if="canTest(item)" id="test-minion" icon :title="i18n.nodeTest" @click="showTestConfirm(item.id + '_' + item.role)">
<v-icon>fa-file-import</v-icon>
</v-btn>
</div>
Expand Down
2 changes: 1 addition & 1 deletion html/js/routes/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions html/js/routes/grid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

0 comments on commit 989821c

Please sign in to comment.