@fortawesome/free-solid-svg-icons#faAddressBook JavaScript Examples

The following examples show how to use @fortawesome/free-solid-svg-icons#faAddressBook. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LteSmallBox.test.jsx    From react-lte with MIT License 6 votes vote down vote up
test('Should render component without crash', () => {
  const dom = <LteSmallBox title={title} message={message} icon={faAddressBook} href={href} />;
  const { container } = render(dom, { wrapper: MemoryRouter });

  expect(container.querySelector('.inner > h3')).toHaveTextContent(title);
  expect(container.querySelector('.inner > p')).toHaveTextContent(message);
  expect(container.querySelector('.icon > svg')).toHaveClass('fa-address-book');
  expect(container.querySelector('a')).toHaveAttribute('href', href);
});
Example #2
Source File: LteSmallBox.test.jsx    From react-lte with MIT License 5 votes vote down vote up
test('Should render component with optional props', () => {
  const dom = <LteSmallBox title={title} message={message} icon={faAddressBook} href={href} />;
  const { container } = render(dom, { wrapper: MemoryRouter });

  expect(container.firstChild.nodeName).toEqual('DIV');
  expect(container.firstChild.getAttribute('class')).toEqual('small-box');
});
Example #3
Source File: LteSmallBox.test.jsx    From react-lte with MIT License 5 votes vote down vote up
test('Should render component with bg color', () => {
  const dom = <LteSmallBox title={title} message={message} icon={faAddressBook} href={href} color='danger' />;
  const { container } = render(dom, { wrapper: MemoryRouter });

  expect(container.firstChild).toHaveClass('bg-danger');
});
Example #4
Source File: LteSmallBox.test.jsx    From react-lte with MIT License 5 votes vote down vote up
test('Should render component with different tag name', () => {
  const dom = <LteSmallBox title={title} message={message} icon={faAddressBook} href={href} tag='section' />;
  const { container } = render(dom, { wrapper: MemoryRouter });

  expect(container.firstChild.nodeName).toEqual('SECTION');
});