@vertisanpro/flowbite-react
Version:
Non-Official React components built for Flowbite and Tailwind CSS
30 lines (29 loc) • 1.14 kB
JavaScript
import { render, screen } from '@testing-library/react';
import React from 'react';
import { describe, expect, it } from 'vitest';
import { Flowbite } from '../Flowbite';
import { Blockquote } from './Blockquote';
describe('Components / Blockquote', () => {
describe('Theme', () => {
it('should use custom `base` classes', () => {
const theme = {
blockquote: {
root: {
base: 'bg-yellow-400 dark:bg-yellow-40',
},
},
};
render(React.createElement(Flowbite, { theme: { theme } },
React.createElement(Blockquote, null)));
expect(blockquote()).toBeInTheDocument();
expect(blockquote()).toHaveClass('bg-yellow-400 dark:bg-yellow-40');
});
});
describe('Rendering', () => {
it('should render when `children={0}`', () => {
render(React.createElement(Blockquote, null, "0"));
expect(blockquote()).toHaveTextContent('0');
});
});
});
const blockquote = () => screen.getByTestId('flowbite-blockquote');