summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/cards-list.test.tsx
blob: f77ee83c44fabab5b9c460a4b2e185263e06354c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35<
import { render, screen } from '@tests/utils';
import CardsList, { type CardsListItem } from './cards-list';

const items: CardsListItem[] = [
  {
    id: 'card-1',
    cover: {
      alt: 'card 1 picture',
      src: 'http://placeimg.com/640/480',
      width: 640,
      height: 480,
    },
    meta: { thematics: ['Velit', 'Ex', 'Alias'] },
    tagline: 'Molestias ut error',
    title: 'Et alias omnis',
    url: '#',
  },
  {
    id: 'card-2',
    cover: {
      alt: 'card 2 picture',
      src: 'http://placeimg.com/640/480',
      width: 640,
      height: 480,
    },
    meta: { thematics: ['Voluptas'] },
    tagline: 'Quod vel accusamus',
    title: 'Laboriosam doloremque mollitia',
    url: '#',
  },
  {
    id: 'card-3',
    cover: {
      alt: 'card 3 picture',
      src: 'http://placeimg.com/640/480',
      width: 640,
      height: 480,
    },
    meta: {
      thematics: ['Quisquam', 'Quia', 'Sapiente', 'Perspiciatis'],
    },
    tagline: 'Quo error eum',
    title: 'Magni rem nulla',
    url: '#',
  },
];

describe('CardsList', () => {
  it('renders a list of cards', () => {
    render(<CardsList items={items} titleLevel={2} />);
    expect(screen.getAllByRole('heading', { level: 2 })).toHaveLength(
      items.length
    );
  });
});
, lookbehind: !0, greedy: !0, }, ], string: [ { pattern: /'''[^'][\s\S]*?'''/, greedy: !0 }, { pattern: /(^|[^\\'])'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'/, lookbehind: !0, greedy: !0, }, ], 'interpolated-string': { pattern: /(^|[^\\'])'(?:\\.|\$(?:(?!\{)|\{[^{}\r\n]*\})|[^'\\\r\n$])*'/, lookbehind: !0, greedy: !0, inside: { interpolation: { pattern: /\$\{[^{}\r\n]*\}/, inside: { expression: { pattern: /(^\$\{)[\s\S]+(?=\}$)/, lookbehind: !0 }, punctuation: /^\$\{|\}$/, }, }, string: /[\s\S]+/, }, }, datatype: { pattern: /(\b(?:output|param)\b[ \t]+\w+[ \t]+)\w+\b/, lookbehind: !0, alias: 'class-name', }, boolean: /\b(?:false|true)\b/, keyword: /\b(?:existing|for|if|in|module|null|output|param|resource|targetScope|var)\b/, decorator: /@\w+\b/, function: /\b[a-z_]\w*(?=[ \t]*\()/i, number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/, punctuation: /[{}[\];(),.:]/, }), (Prism.languages.bicep[ 'interpolated-string' ].inside.interpolation.inside.expression.inside = Prism.languages.bicep);