Skip to content
Snippets Groups Projects
Unverified Commit ec7f74d4 authored by Gustavo Saiani's avatar Gustavo Saiani Committed by GitHub
Browse files

Update bookmark icon when switching from question to model and back (#24376)

parent e1468cd6
No related branches found
No related tags found
No related merge requests found
......@@ -47,12 +47,12 @@ const Bookmarks = createEntity({
},
reducer: (state = {}, { type, payload, error }) => {
if (type === Questions.actionTypes.UPDATE && payload?.object) {
const { archived, id, name } = payload.object;
const { archived, dataset, id, name } = payload.object;
const key = `card-${id}`;
if (archived) {
return dissoc(state, key);
} else {
return updateIn(state, [key], item => ({ ...item, name }));
return updateIn(state, [key], item => ({ ...item, dataset, name }));
}
}
......
import {
restore,
navigationSidebar,
openQuestionActions,
openNavigationSidebar,
visitQuestion,
} from "__support__/e2e/helpers";
......@@ -30,6 +31,23 @@ describe("scenarios > question > bookmarks", () => {
cy.findByText("Orders 2");
});
// Convert to model
openQuestionActions();
cy.findByText("Turn into a model").click();
cy.findByText("Turn this into a model").click();
navigationSidebar().within(() => {
cy.icon("model");
});
// Convert back to question
openQuestionActions();
cy.findByText("Turn back to saved question").click();
navigationSidebar().within(() => {
cy.icon("model").should("not.exist");
});
// Remove bookmark
toggleBookmark();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment