mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
* fix: remove circular dependency redux depended on templates/Challenges/redux and vice versa. This meant that import order mattered and confusing bugs could arise. (cherry picked from commit 7d67a4e70922bbb3051f2f9982dcc69e240d43dc) * feat: require imports to be in alphabetical order Import order generally does not matter, but there are edge cases (circular imports and css imports, for example) where changing order changes behaviour (cherry picked from commit b8d1393a91ec6e068caf8e8498a5c95df68c2b2c) * chore: order imports * fix: lift up challenge description + title comps This brings the classic Show closer to the others as they now all create the description and title components * fix: remove donation-saga/index circular import (cherry picked from commit 51a44ca668a700786d2744feffeae4fdba5fd207) * refactor: extract action-types from settings (cherry picked from commit 25e26124d691c84a0d0827d41dafb761c686fadd) * fix: lint errors * feat: prevent useless renames
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import { render, cleanup, screen } from '@testing-library/react';
|
|
import React from 'react';
|
|
|
|
import Loader from './loader';
|
|
|
|
describe('<Loader />', () => {
|
|
afterEach(cleanup);
|
|
|
|
it('renders to the DOM', () => {
|
|
const { container } = render(<Loader />);
|
|
expect(container).toBeTruthy();
|
|
});
|
|
|
|
it('adds the correct class when given a fullScreen prop', () => {
|
|
render(<Loader fullScreen={true} />);
|
|
const fccLoader = screen.getByTestId('fcc-loader');
|
|
expect(fccLoader).toHaveClass('full-screen-wrapper');
|
|
});
|
|
|
|
/**
|
|
* As we only wrap another library Component,
|
|
* there is nothing much to test except snapshots
|
|
*/
|
|
|
|
it('matches to the default render snapshot', () => {
|
|
render(<Loader />);
|
|
const fccLoader = screen.getByTestId('fcc-loader');
|
|
expect(fccLoader).toMatchSnapshot();
|
|
});
|
|
|
|
it('matches the fullScreen render snapshot', () => {
|
|
render(<Loader fullScreen={true} />);
|
|
const fccLoader = screen.getByTestId('fcc-loader');
|
|
expect(fccLoader).toMatchSnapshot();
|
|
});
|
|
});
|