Skip to content

Commit

Permalink
Apply first round of review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
surchs committed Oct 24, 2023
1 parent 3c88725 commit cd4f8f1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
10 changes: 0 additions & 10 deletions cypress/component/category-toolgroup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ describe("Tool Group component", () => {
};
});

it("mounts", () => {
cy.mount(categoryToolGroup, {
mocks: {

$store: store
}
});

});

it("if nothing is selected or mapped, component is empty", () => {
store.state.columnToCategoryMap = {
column1: null,
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/page/annotation-pagetests.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ describe("tests on annotation page ui with programmatic state loading and store
it("Annotate age column; default age format transformations", () => {

cy.window().its("$nuxt.$store").then(p_store => {
console.dir(p_store);
});

// 0. Categories required for this test and the number of required columns for each category
Expand Down
3 changes: 1 addition & 2 deletions cypress/unit/store-mutation-createToolGroup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ describe("createToolGroup mutation", () => {
};
});

it("Makes sure an annotated value is set in the value map", () => {
it("Makes sure mutation sets a value in the toolTerms state object", () => {

// Act
mutations.createToolGroup(store.state, { identifier: 'cogAtlas:MOCA', label: 'MOCA' });
console.log(store.state.toolTerms);
// Assert
expect(store.state.toolTerms.filter(tool => tool.identifier === 'cogAtlas:MOCA')[0]['selected']).to.be.true;
});
Expand Down
3 changes: 1 addition & 2 deletions store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,15 +763,14 @@ export const mutations = {
},

alterColumnToToolMapping(p_state, {columnName, toolIdentifier}) {
if ( p_state.columnToToolMap[columnName] == toolIdentifier ) {
if ( p_state.columnToToolMap[columnName] === toolIdentifier ) {
p_state.columnToToolMap[columnName] = null;
} else {
p_state.columnToToolMap[columnName] = toolIdentifier;
}
},

createToolGroup(p_state, newTool) {
console.log('state is', p_state.toolTerms, 'newTool is', 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 cd4f8f1

Please sign in to comment.