mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 08:23:16 +00:00
lint, unit tests
This commit is contained in:
@@ -14,8 +14,8 @@ describe("register idps", () => {
|
|||||||
it("should redirect the user to the correct url", () => {
|
it("should redirect the user to the correct url", () => {
|
||||||
cy.visit("/register/idp");
|
cy.visit("/register/idp");
|
||||||
cy.get('button[e2e="google"]').click();
|
cy.get('button[e2e="google"]').click();
|
||||||
cy.origin(IDP_URL, ()=> {
|
cy.origin(IDP_URL, () => {
|
||||||
cy.location("href", { timeout: 10_000 }).should("eq", IDP_URL);
|
cy.location("href", { timeout: 10_000 }).should("eq", IDP_URL);
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,9 +7,15 @@ describe("<SignInWithGitlab />", () => {
|
|||||||
expect(container.firstChild).toBeDefined();
|
expect(container.firstChild).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("displays the correct text", () => {
|
it("displays the default text", () => {
|
||||||
render(<SignInWithGitlab />);
|
render(<SignInWithGitlab />);
|
||||||
const signInText = screen.getByText(/Sign in with Gitlab/i);
|
const signInText = screen.getByText(/Sign in with Gitlab/i);
|
||||||
expect(signInText).toBeInTheDocument();
|
expect(signInText).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("displays the given text", () => {
|
||||||
|
render(<SignInWithGitlab name={"Gitlab"} />);
|
||||||
|
const signInText = screen.getByText(/Gitlab/i);
|
||||||
|
expect(signInText).toBeInTheDocument();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from "@testing-library/react";
|
||||||
import { SignInWithGitlab } from './SignInWithGitlab';
|
import { SignInWithGoogle } from "./SignInWithGoogle";
|
||||||
|
|
||||||
describe('<SignInWithGitlab />', () => {
|
describe("<SignInWithGoogle />", () => {
|
||||||
it('renders without crashing', () => {
|
it("renders without crashing", () => {
|
||||||
const { container } = render(<SignInWithGitlab />);
|
const { container } = render(<SignInWithGoogle />);
|
||||||
expect(container.firstChild).toBeDefined();
|
expect(container.firstChild).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('displays the correct text', () => {
|
it("displays the default text", () => {
|
||||||
render(<SignInWithGitlab />);
|
render(<SignInWithGoogle />);
|
||||||
const signInText = screen.getByText(/Sign in with Gitlab/i);
|
const signInText = screen.getByText(/Sign in with Google/i);
|
||||||
expect(signInText).toBeInTheDocument();
|
expect(signInText).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
it("displays the given text", () => {
|
||||||
|
render(<SignInWithGoogle name={"Google"} />);
|
||||||
|
const signInText = screen.getByText(/Google/i);
|
||||||
|
expect(signInText).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user