Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions app/components/Footer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
it('renders community text', () => {
render(<Footer />);

expect(screen.getByText(/Designed for the elite builder community/i)).toBeInTheDocument();
expect(screen.getByText(/Designed for the elite builder community/i)).toBeTruthy();
});

it('renders Documentation link with the correct destination', () => {
Expand Down Expand Up @@ -38,21 +38,47 @@
it('renders Contributors link', () => {
render(<Footer />);

expect(
screen.getByRole('link', {
name: /Contributors/i,
})
).toBeInTheDocument();
expect(screen.getByText(/Contributors/i)).toBeTruthy();
});

it('renders Creator link to creator GitHub profile', () => {
it('renders Creator link', () => {
render(<Footer />);

const creatorLink = screen.getByRole('link', {
name: /Creator Sourav Jha on GitHub/i,
});
const creatorLink = screen.getByText(/Creator/i);

expect(creatorLink.closest('a')?.getAttribute('href')).toBe('https://github.com/jhasourav07');
});

it('renders footer landmark for accessibility', () => {
render(<Footer />);

expect(screen.getByRole('contentinfo')).toBeTruthy();
});

it('renders copyright text', () => {
render(<Footer />);

expect(screen.getByText(/© 2026 CommitPulse. All rights reserved./i)).toBeTruthy();
});
});

describe('Footer Responsive Layout', () => {
it('contains responsive classes for mobile and desktop layouts', () => {
const { container } = render(<Footer />);

const layoutContainer = container.querySelector('.mx-auto');

expect(layoutContainer).toBeTruthy();
expect(layoutContainer?.className).toContain('flex-col');

Check failure on line 72 in app/components/Footer.test.tsx

View workflow job for this annotation

GitHub Actions / Format · Lint · Typecheck · Test

app/components/Footer.test.tsx > Footer Responsive Layout > contains responsive classes for mobile and desktop layouts

AssertionError: expected 'mx-auto max-w-6xl' to contain 'flex-col' Expected: "flex-col" Received: "mx-auto max-w-6xl" ❯ app/components/Footer.test.tsx:72:40
expect(layoutContainer?.className).toContain('md:flex-row');
});

it('contains responsive text alignment classes', () => {
render(<Footer />);

const heading = screen.getByText('CommitPulse');

expect(creatorLink).toHaveAttribute('href', 'https://github.com/jhasourav07');
expect(heading.parentElement?.className).toContain('md:text-left');

Check failure on line 81 in app/components/Footer.test.tsx

View workflow job for this annotation

GitHub Actions / Format · Lint · Typecheck · Test

app/components/Footer.test.tsx > Footer Responsive Layout > contains responsive text alignment classes

AssertionError: expected 'flex flex-col items-start lg:col-span…' to contain 'md:text-left' Expected: "md:text-left" Received: "flex flex-col items-start lg:col-span-1" ❯ app/components/Footer.test.tsx:81:46
});

it('renders Discord community link', () => {
Expand Down
Loading