diff --git a/playwright/e2eTests/teamsOperations.spec.ts b/playwright/e2eTests/teamsOperations.spec.ts index 877d4f434..5c8634aef 100644 --- a/playwright/e2eTests/teamsOperations.spec.ts +++ b/playwright/e2eTests/teamsOperations.spec.ts @@ -35,6 +35,7 @@ test("Add team", async ({ page, teamName, teamDescription, teamsPage }) => { }); test("Edit team description", async ({ page, teamDescription, teamsPage, teamName }) => { + await teamsPage.teamCardKebab.click(); await teamsPage.editTeamButton.click(); await expect(teamsPage.nameInput("Team name")).toHaveValue(teamName); await expect(teamsPage.teamDescription).toContainText(teamDescription); @@ -64,7 +65,8 @@ test("Delete user", async ({ page, userName, teamsPage }) => { }); test("Delete team", async ({ page, teamName, teamsPage }) => { - await teamsPage.deleteTeamButton(teamName + " changed").click(); + await teamsPage.teamCardKebab.click(); + await teamsPage.deleteTeamButton.click(); await page.getByRole("button", { name: "Confirm" }).click(); await expect( page.locator(`:text("${teamName}"):right-of(span[data-tid='Delete team ${teamName}'])`) diff --git a/playwright/e2eTests/triggerOperations.spec.ts b/playwright/e2eTests/triggerOperations.spec.ts index 0ebefe729..0775a32b6 100644 --- a/playwright/e2eTests/triggerOperations.spec.ts +++ b/playwright/e2eTests/triggerOperations.spec.ts @@ -79,8 +79,7 @@ test("Set trigger maintenance for all intervals", async ({ triggerName, page }) const requestBody = JSON.parse(setMaintenanceRequest.postData() || "{}"); expect(requestBody).not.toBeNull(); - expect(requestBody.trigger).toEqual(expectedTriggerTime); - + expect(Math.abs(requestBody.trigger - expectedTriggerTime)).toBeLessThanOrEqual(1); if (maintenance === Maintenance.off) { await expect(page.getByText("Maintenance")).toBeVisible(); } else diff --git a/playwright/pages/teams.page.ts b/playwright/pages/teams.page.ts index 1de8d9a39..5b2535bac 100644 --- a/playwright/pages/teams.page.ts +++ b/playwright/pages/teams.page.ts @@ -6,11 +6,12 @@ export class TeamsPage { readonly nameInput: (testId: string) => Locator; readonly teamDescription: Locator; readonly previewButton: Locator; + readonly teamCardKebab: Locator; readonly editTeamButton: Locator; readonly showUsersButton: Locator; readonly addUserModalButton: Locator; readonly deleteUserButton: (userName: string) => Locator; - readonly deleteTeamButton: (teamName: string) => Locator; + readonly deleteTeamButton: Locator; constructor(page: Page) { this.page = page; @@ -18,11 +19,12 @@ export class TeamsPage { this.nameInput = (testId) => page.locator(`label[data-tid='${testId}'] > span > input`); this.teamDescription = page.locator("[data-tid='Team description']"); this.previewButton = page.getByText("Preview"); - this.editTeamButton = page.getByRole("button", { name: "Edit Team" }); + this.teamCardKebab = page.locator("[data-tid='Team card kebab']"); + this.editTeamButton = page.getByRole("button", { name: "Edit" }); this.showUsersButton = page.getByText("Show users"); this.addUserModalButton = page.locator("[data-tid='Add user modal']"); this.deleteUserButton = (userName) => page.locator(`[data-tid="Delete user ${userName}"]`); - this.deleteTeamButton = (teamName) => page.locator(`[data-tid="Delete team ${teamName}"]`); + this.deleteTeamButton = page.getByRole("button", { name: "Delete" }); } async gotoTeamsPage(): Promise { diff --git a/src/Components/ChristmasMoodToggle/ChristmasMoodToggle.tsx b/src/Components/ChristmasMoodToggle/ChristmasMoodToggle.tsx index 75ed25691..c4c1e06ef 100644 --- a/src/Components/ChristmasMoodToggle/ChristmasMoodToggle.tsx +++ b/src/Components/ChristmasMoodToggle/ChristmasMoodToggle.tsx @@ -3,18 +3,25 @@ import { Toggle } from "@skbkontur/react-ui/components/Toggle"; import { useChristmasMood } from "../../hooks/useChristmasMood"; import { useAppDispatch } from "../../store/hooks"; import { toggleChristmasMood } from "../../store/Reducers/UIReducer.slice"; +import { useSelector } from "react-redux"; +import { selectIsChristmasMood } from "../../store/Reducers/ConfigReducer.slice"; export const ChristmasMoodToggle: FC = () => { const dispatch = useAppDispatch(); const [isChristmasMood, setChristmasMood] = useChristmasMood(); + const isChristmasMoodEnabled = useSelector(selectIsChristmasMood); const handleToggleChristmasMood = (selected: boolean) => { setChristmasMood(selected); dispatch(toggleChristmasMood(selected)); }; return ( - - New Year mood - + <> + {isChristmasMoodEnabled ? ( + + New Year mood + + ) : null} + ); }; diff --git a/src/Components/Grid/Grid.less b/src/Components/Grid/Grid.less index 62015ecee..d51e05a9c 100644 --- a/src/Components/Grid/Grid.less +++ b/src/Components/Grid/Grid.less @@ -1,4 +1,3 @@ .grid { display: grid; - align-items: baseline; } diff --git a/src/Components/Header/Header.tsx b/src/Components/Header/Header.tsx index f44b6a91e..1dbc0179a 100644 --- a/src/Components/Header/Header.tsx +++ b/src/Components/Header/Header.tsx @@ -9,7 +9,7 @@ import RouterLink from "../RouterLink/RouterLink"; import svgLogo from "./moira-logo.svg"; import { AdminMenu } from "./Components/AdminMenu"; import { useSelector } from "react-redux"; -import { selectIsChristmasMood, selectPlatform } from "../../store/Reducers/ConfigReducer.slice"; +import { selectPlatform } from "../../store/Reducers/ConfigReducer.slice"; import { useGetConfigQuery } from "../../services/BaseApi"; import { Platform } from "../../Domain/Config"; import { ChristmasHatSVG } from "./Components/ChristmasHat"; @@ -29,7 +29,6 @@ export default function Header(): React.ReactElement { const { isLoading } = useGetConfigQuery(); const theme = useTheme(); const { isChristmasMood } = useAppSelector(UIState); - const isChristmasMoodEnabled = useSelector(selectIsChristmasMood); return (