All files / lib/components/Example index.tsx

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 36 37 38 39 40                        2x                         1x               1x            
import Link from 'next/link';
import { css } from '@emotion/react';
import React from 'react';
import { pageRouteToPathname } from '@lib/constants/routes';
import { PageRoute } from '@lib/models/routes';
 
interface ExampleProps {
  a: number;
  onClickAdd: () => unknown;
}
 
export default function Example({ a, onClickAdd }: ExampleProps) {
  return (
    <div css={mainContainer}>
      <div css={aContainer}>
        {a}인데 말이여
        <button type="button" onClick={onClickAdd} data-testid="Example_add_btn">
          더해보슈
        </button>
      </div>
      <Link href={pageRouteToPathname[PageRoute.ROOT]}>메인 화면으로 돌아가보실래요</Link>
    </div>
  );
}
 
const mainContainer = css`
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
`;
 
const aContainer = css`
  font-size: 2rem;
  display: flex;
  flex-direction: row;
  gap: 6px;
`;