mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* remove code outside of the topnav feature flag * delete NavBar folder * remove topnav toggle from backend * restructure AppChrome folder * fix utils mock * fix applinks tests * remove tests since they're covered in e2e * fix 1 of the approotpage tests * Fix another dashboardpage test * remove reverse portalling + test for plugins using deprecated onNavChanged method * kick drone * handle correlations
28 lines
985 B
TypeScript
28 lines
985 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import React from 'react';
|
|
|
|
import { NavLandingPageCard } from './NavLandingPageCard';
|
|
|
|
describe('NavLandingPageCard', () => {
|
|
const mockText = 'My heading';
|
|
const mockUrl = 'http://www.example.com/';
|
|
|
|
it('uses the text as a heading', () => {
|
|
render(<NavLandingPageCard text={mockText} url={mockUrl} />);
|
|
expect(screen.getByRole('heading', { name: mockText })).toBeInTheDocument();
|
|
});
|
|
|
|
it('labels the link correctly', () => {
|
|
render(<NavLandingPageCard text={mockText} url={mockUrl} />);
|
|
const link = screen.getByRole('link', { name: mockText });
|
|
expect(link).toBeInTheDocument();
|
|
expect(link).toHaveProperty('href', mockUrl);
|
|
});
|
|
|
|
it('renders the description', () => {
|
|
const mockDescription = 'My description';
|
|
render(<NavLandingPageCard text={mockText} url={mockUrl} description={mockDescription} />);
|
|
expect(screen.getByText(mockDescription)).toBeInTheDocument();
|
|
});
|
|
});
|