mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 06:42:59 +00:00
lint, unit tests
This commit is contained in:
@@ -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