Skip to content

Commit

Permalink
Refactor tool group mutation name
Browse files Browse the repository at this point in the history
  • Loading branch information
surchs committed Oct 24, 2023
1 parent 76356fb commit 37538f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/category-toolgroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
methods: {
...mapMutations([
"createToolGroup",
"createAssessmentTool",
"alterColumnToToolMapping"
]),
selectTool(selectedTool) {
if ( selectedTool !== null ) {
this.createToolGroup({
this.createAssessmentTool({
identifier: selectedTool.identifier,
label: selectedTool.label
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/unit/store-mutation-createToolGroup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

});
});
2 changes: 1 addition & 1 deletion store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
},
Expand Down

0 comments on commit 37538f2

Please sign in to comment.