Fix Cypress tests

This commit is contained in:
Kalle (Sendou)
2021-12-25 23:10:03 +02:00
parent a4d45e2577
commit a5a90ec616
4 changed files with 10 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ export function ActionSectionBeforeStartContent({
if (!checkInHasStarted && !teamHasEnoughMembers) {
return (
<ActionSectionWrapper icon="warning">
<ActionSectionWrapper icon="warning" data-cy="team-size-alert">
<AlertIcon /> You need at least 4 players in your roster to play
</ActionSectionWrapper>
);

View File

@@ -3,16 +3,22 @@ import { MyCSSProperties } from "~/utils";
export function ActionSectionWrapper({
children,
icon,
...rest
}: {
children: React.ReactNode;
icon: "warning" | "info" | "success" | "error";
"data-cy"?: string;
}) {
// todo: flex-dir: column on mobile
const style: MyCSSProperties = {
"--action-section-icon-color": `var(--theme-${icon})`,
};
return (
<section className="tournament__action-section" style={style}>
<section
className="tournament__action-section"
style={style}
data-cy={rest["data-cy"]}
>
<div className="tournament__action-section__content">{children}</div>
</section>
);

View File

@@ -140,7 +140,7 @@ export default function ManageRosterPage() {
return (
<div className="tournament__manage-roster">
{ownTeam.members.length >= TOURNAMENT_TEAM_ROSTER_MAX_SIZE && (
<Alert type="info" data-cy="team-size-alert">
<Alert type="info">
Your team is full - more players can't be added
</Alert>
)}

View File

@@ -27,7 +27,7 @@ describe("Before tournament starts", () => {
cy.getCy("log-in-to-join-button");
cy.getCy("map-pool-nav-link").click();
cy.contains("24 maps");
cy.contains("26 maps");
cy.get('[alt="Moray Towers"]').should(
"have.class",
"map-pool__stage-image-disabled"