github.com/freiheit-com/kuberpult@v1.24.2-0.20240328135542-315d5630abe6/services/frontend-service/src/ui/components/button/button.test.tsx (about)

     1  /*This file is part of kuberpult.
     2  
     3  Kuberpult is free software: you can redistribute it and/or modify
     4  it under the terms of the Expat(MIT) License as published by
     5  the Free Software Foundation.
     6  
     7  Kuberpult is distributed in the hope that it will be useful,
     8  but WITHOUT ANY WARRANTY; without even the implied warranty of
     9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    10  MIT License for more details.
    11  
    12  You should have received a copy of the MIT License
    13  along with kuberpult. If not, see <https://directory.fsf.org/wiki/License:Expat>.
    14  
    15  Copyright 2023 freiheit.com*/
    16  import { Button } from './button';
    17  import { render } from '@testing-library/react';
    18  
    19  describe('Button', () => {
    20      const getNode = () => <Button className={'button--test'} label={'Test Me'} />;
    21      const getWrapper = () => render(getNode());
    22      it('renders a button', () => {
    23          const { container } = getWrapper();
    24          expect(container.firstChild).toMatchInlineSnapshot(`
    25      <button
    26        aria-label="Test Me"
    27        class="mdc-button button--test"
    28      >
    29        <div
    30          class="mdc-button__ripple"
    31        />
    32        <span
    33          class="mdc-button__label"
    34        >
    35          Test Me
    36        </span>
    37      </button>
    38    `);
    39      });
    40  });