From 37538f2168800b0156bf872a7436f39558f5fd2c Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Tue, 24 Oct 2023 13:57:06 -0400 Subject: [PATCH] Refactor tool group mutation name --- components/category-toolgroup.vue | 4 ++-- cypress/unit/store-mutation-createToolGroup.cy.js | 4 ++-- store/index.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/category-toolgroup.vue b/components/category-toolgroup.vue index 78364990..3c2ceb14 100644 --- a/components/category-toolgroup.vue +++ b/components/category-toolgroup.vue @@ -79,12 +79,12 @@ methods: { ...mapMutations([ - "createToolGroup", + "createAssessmentTool", "alterColumnToToolMapping" ]), selectTool(selectedTool) { if ( selectedTool !== null ) { - this.createToolGroup({ + this.createAssessmentTool({ identifier: selectedTool.identifier, label: selectedTool.label }); diff --git a/cypress/unit/store-mutation-createToolGroup.cy.js b/cypress/unit/store-mutation-createToolGroup.cy.js index cb29480f..2f670210 100644 --- a/cypress/unit/store-mutation-createToolGroup.cy.js +++ b/cypress/unit/store-mutation-createToolGroup.cy.js @@ -29,9 +29,9 @@ describe("createToolGroup mutation", () => { it("Makes sure mutation sets a value in the toolTerms state object", () => { // Act - mutations.createToolGroup(store.state, { identifier: 'cogAtlas:MOCA', label: 'MOCA' }); + mutations.createAssessmentTool(store.state, { identifier: 'cogAtlas:MOCA', label: 'MOCA' }); // Assert expect(store.state.toolTerms.filter(tool => tool.identifier === 'cogAtlas:MOCA')[0]['selected']).to.be.true; }); -}); \ No newline at end of file +}); diff --git a/store/index.js b/store/index.js index b1f9f96e..f9e63746 100644 --- a/store/index.js +++ b/store/index.js @@ -770,7 +770,7 @@ export const mutations = { } }, - createToolGroup(p_state, newTool) { + createAssessmentTool(p_state, newTool) { const toolIndex = p_state.toolTerms.findIndex(tool => tool.identifier === newTool.identifier); p_state.toolTerms.splice(toolIndex, 1, Object.assign(p_state.toolTerms[toolIndex], { selected: true })); },