Skip to content
Snippets Groups Projects
Unverified Commit 75be28c2 authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Fix group caching issue (#19526)

parent f3c09a0f
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ import Group from "metabase/entities/groups";
import GroupsListing from "../components/GroupsListing";
import { getGroupsWithoutMetabot } from "../selectors";
@Group.loadList()
@Group.loadList({ reload: true })
@connect((state, props) => ({
groups: getGroupsWithoutMetabot(state, props),
}))
......
import { restore } from "__support__/e2e/cypress";
const GROUP = "collection";
describe("should update group count after editing a group", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
});
it("should update the group count after adding a user to a group (metabase#12693)", () => {
cy.visit("/admin/people/groups");
findRow(GROUP).within(() => cy.findByText("3"));
cy.findByText(GROUP).click();
cy.findByText("Add members").click();
cy.focused().type("Bobby");
cy.findByText("Bobby Tables").click();
cy.findByText("Add").click();
cy.findByText("4 members");
cy.findByText("Groups").click();
findRow(GROUP).within(() => cy.findByText("4"));
});
it("should update the group count after removing a user from a group (metabase#12693)", () => {
cy.visit("/admin/people/groups");
findRow(GROUP).within(() => cy.findByText("3"));
cy.findByText(GROUP).click();
findRow("User 1").within(() => cy.findByLabelText("close icon").click());
cy.findByText("2 members");
cy.findByText("Groups").click();
findRow(GROUP).within(() => cy.findByText("2"));
});
});
const findRow = text => {
return cy.findByText(text).parentsUntil("tbody", "tr");
};
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