summaryrefslogtreecommitdiffstats
path: root/src/components/atoms/lists/description-list.test.tsx
blob: 22421b0e499fbd84c83ac8642586553e34d6e635 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { render } from '@tests/utils';
import DescriptionList, { DescriptionListItem } from './description-list';

const items: DescriptionListItem[] = [
  { id: 'term-1', label: 'Term 1:', value: ['Value for term 1'] },
  { id: 'term-2', label: 'Term 2:', value: ['Value for term 2'] },
  {
    id: 'term-3',
    label: 'Term 3:',
    value: ['Value 1 for term 3', 'Value 2 for term 3', 'Value 3 for term 3'],
  },
  { id: 'term-4', label: 'Term 4:', value: ['Value for term 4'] },
];

describe('DescriptionList', () => {
  it('renders a list of terms and description', () => {
    const { container } = render(<DescriptionList items={items} />);
    expect(container).toBeDefined();
  });
});
s="p">('clike', { string: { pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/, lookbehind: true, greedy: true, }, 'class-name': [ { // e.g. class Rectangle { ... } pattern: /(\bclass\s+)\w+/, lookbehind: true, }, { // e.g. attr Rectangle::height, def Rectangle::area() { ... } pattern: /(\b(?:attr|def)\s+)\w+(?=\s*::)/, lookbehind: true, }, ], keyword: /\b(?:attr|auto|break|case|catch|class|continue|def|default|else|finally|for|fun|global|if|return|switch|this|try|var|while)\b/, number: [Prism.languages.cpp.number, /\b(?:Infinity|NaN)\b/], operator: />>=?|<<=?|\|\||&&|:[:=]?|--|\+\+|[=!<>+\-*/%|&^]=?|[?~]|`[^`\r\n]{1,4}`/, }); Prism.languages.insertBefore('chaiscript', 'operator', { 'parameter-type': { // e.g. def foo(int x, Vector y) {...} pattern: /([,(]\s*)\w+(?=\s+\w)/, lookbehind: true, alias: 'class-name', }, }); Prism.languages.insertBefore('chaiscript', 'string', { 'string-interpolation': { pattern: /(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/, lookbehind: true, greedy: true, inside: { interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/, lookbehind: true, inside: { 'interpolation-expression': { pattern: /(^\$\{)[\s\S]+(?=\}$)/, lookbehind: true, inside: Prism.languages.chaiscript, }, 'interpolation-punctuation': { pattern: /^\$\{|\}$/, alias: 'punctuation', }, }, }, string: /[\s\S]+/, }, }, });