mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-12 13:36:43 +00:00
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import NavBar from '../NavBar';
|
|
import {render, RenderResult} from '@testing-library/react';
|
|
|
|
describe('Navbar displays', () => {
|
|
let context: RenderResult;
|
|
|
|
beforeEach(() => {
|
|
context = render(<NavBar />);
|
|
});
|
|
|
|
describe('when user is not authenticated', () => {
|
|
test('landing page link', () => {
|
|
const {getByText} = context;
|
|
const link = getByText('DevBook');
|
|
expect(link).toBeInTheDocument();
|
|
});
|
|
test('developers link', () => {
|
|
const {getByText} = context;
|
|
const link = getByText('Developers');
|
|
expect(link).toBeInTheDocument();
|
|
});
|
|
test('register link', () => {
|
|
const {getByText} = context;
|
|
const link = getByText('Register');
|
|
expect(link).toBeInTheDocument();
|
|
});
|
|
test('login page link', () => {
|
|
const {getByText} = context;
|
|
const link = getByText('Login');
|
|
expect(link).toBeInTheDocument();
|
|
});
|
|
});
|
|
|
|
describe('when user is authenticated', () => {
|
|
test('logout page link', () => {
|
|
const {getByText} = context;
|
|
const link = getByText('Logout');
|
|
expect(link).toBeInTheDocument();
|
|
});
|
|
});
|
|
});
|