mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 09:54:00 +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", () => {
|
||||
cy.visit("/register/idp");
|
||||
cy.get('button[e2e="google"]').click();
|
||||
cy.origin(IDP_URL, ()=> {
|
||||
cy.origin(IDP_URL, () => {
|
||||
cy.location("href", { timeout: 10_000 }).should("eq", IDP_URL);
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,9 +7,15 @@ describe("<SignInWithGitlab />", () => {
|
||||
expect(container.firstChild).toBeDefined();
|
||||
});
|
||||
|
||||
it("displays the correct text", () => {
|
||||
it("displays the default text", () => {
|
||||
render(<SignInWithGitlab />);
|
||||
const signInText = screen.getByText(/Sign in with Gitlab/i);
|
||||
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 { SignInWithGitlab } from './SignInWithGitlab';
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { SignInWithGoogle } from "./SignInWithGoogle";
|
||||
|
||||
describe('<SignInWithGitlab />', () => {
|
||||
it('renders without crashing', () => {
|
||||
const { container } = render(<SignInWithGitlab />);
|
||||
expect(container.firstChild).toBeDefined();
|
||||
});
|
||||
describe("<SignInWithGoogle />", () => {
|
||||
it("renders without crashing", () => {
|
||||
const { container } = render(<SignInWithGoogle />);
|
||||
expect(container.firstChild).toBeDefined();
|
||||
});
|
||||
|
||||
it('displays the correct text', () => {
|
||||
render(<SignInWithGitlab />);
|
||||
const signInText = screen.getByText(/Sign in with Gitlab/i);
|
||||
expect(signInText).toBeInTheDocument();
|
||||
});
|
||||
it("displays the default text", () => {
|
||||
render(<SignInWithGoogle />);
|
||||
const signInText = screen.getByText(/Sign in with Google/i);
|
||||
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