import { render, screen } from '@test-utils'; import Pagination from './pagination'; const total = 50; const perPage = 10; describe('Pagination', () => { it('renders previous and next page links', () => { render(); expect( screen.getByRole('link', { name: /Previous page/i }) ).toBeInTheDocument(); expect( screen.getByRole('link', { name: /Next page/i }) ).toBeInTheDocument(); }); it('renders the page links except for the current one', () => { render( ); expect(screen.getAllByRole('link', { name: /Page / })).toHaveLength( total / perPage - 1 ); }); }); ef='/'>index : www.armandphilippot.com
The frontend of my personal website.Armand Philippot
aboutsummaryrefslogtreecommitdiffstats
blob: bb868d14e0bcb8d438bbbf30e6ec6451c531dddb (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
// https://qiskit.github.io/openqasm/grammar/index.html

Prism.languages.openqasm = {
  comment: /\/\*[\s\S]*?\*\/|\/\/.*/,
  string: {
    pattern: /"[^"\r\n\t]*"|'[^'\r\n\t]*'/,
    greedy: true,
  },

  keyword:
    /\b(?:CX|OPENQASM|U|barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while)\b|#pragma\b/,
  'class-name':
    /\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/,
  function: /\b(?:cos|exp|ln|popcount|rotl|rotr|sin|sqrt|tan)\b(?=\s*\()/,

  constant: /\b(?:euler|pi|tau)\b|ฯ€|๐œ|โ„‡/,
  number: {
    pattern:
      /(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|ยตs|ms|s)?/i,
    lookbehind: true,
  },
  operator: /->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/,
  punctuation: /[(){}\[\];,:.]/,
};

Prism.languages.qasm = Prism.languages.openqasm;