From d75b9a1e150ab211c1052fb49bede9bd16320aca Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 7 Oct 2023 18:44:14 +0200 Subject: feat(components): add a generic Flip component The flipping animation is used at several places so it makes sense to use a single component to handle the animation. It will avoid styles duplication. --- .../forms/flipping-label/flipping-label.test.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/components/molecules/forms/flipping-label/flipping-label.test.tsx') diff --git a/src/components/molecules/forms/flipping-label/flipping-label.test.tsx b/src/components/molecules/forms/flipping-label/flipping-label.test.tsx index 71ea2ba..d59c5f3 100644 --- a/src/components/molecules/forms/flipping-label/flipping-label.test.tsx +++ b/src/components/molecules/forms/flipping-label/flipping-label.test.tsx @@ -1,15 +1,18 @@ import { describe, expect, it } from '@jest/globals'; -import { render, screen } from '../../../../../tests/utils'; +import { render, screen as rtlScreen } from '@testing-library/react'; +import { Icon } from '../../../atoms'; import { FlippingLabel } from './flipping-label'; describe('FlippingLabel', () => { it('renders a label', () => { - const ariaLabel = 'vero quo inventore'; + const label = 'vero quo inventore'; render( - - <>Test - + } + isActive={false} + label={label} + /> ); - expect(screen.getByLabelText(ariaLabel)).toBeInTheDocument(); + expect(rtlScreen.getByText(label)).toBeInTheDocument(); }); }); -- cgit v1.2.3