Skip to content

Commit

Permalink
[FIX] column no longer styled if selectedTool is null
Browse files Browse the repository at this point in the history
  • Loading branch information
surchs committed Oct 17, 2023
1 parent ea0dbc8 commit d3ebcf8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/category-toolgroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@
this.alterColumnToToolMapping({columnName: row.column, toolIdentifier: this.selectedTool.identifier});
},
styleRow(p_row) {
if (this.columnToToolMap[p_row.column] === this.selectedTool.identifier) {
if (
(this.columnToToolMap[p_row.column] !== null) &&
(this.columnToToolMap[p_row.column] === this.selectedTool.identifier)
) {
return "selected-tool";
} else {
return "";
Expand All @@ -119,4 +122,4 @@
background-color: red !important;
}
</style>
</style>
19 changes: 19 additions & 0 deletions cypress/component/category-toolgroup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,25 @@ describe("Tool Group component", () => {
cy.get("[data-cy='assessment-column-table']").contains("column3");
});

it("before a tool is selected, all columns are unstyled", () => {
store.state.columnToToolMap = {
column1: null,
column2: null,
column3: null
};

cy.mount(categoryToolGroup, {
mocks: {

$store: store
}
});

cy.get("[data-cy='assessment-column-table']").find("tr:contains('column1')").should('not.have.class', 'selected-tool');
cy.get("[data-cy='assessment-column-table']").find("tr:contains('column3')").should('not.have.class', 'selected-tool');

});

it("gets assessment tool names from the store and shows them in a dropdown", () => {
cy.mount(categoryToolGroup, {
mocks: {
Expand Down

0 comments on commit d3ebcf8

Please sign in to comment.