aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/tooltip/tooltip.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-31 16:00:45 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:15:27 +0100
commit3ff4c37a7a2c40340c17f9e6c1754444bce0f839 (patch)
tree551ca3df148d46af2bd27995fa98c01378030644 /src/components/molecules/tooltip/tooltip.test.tsx
parent0e52a59917406ad03c174e030c6c1c92ab23449d (diff)
refactor(components): rewrite Modal component
* add an optional close button * add an icon prop
Diffstat (limited to 'src/components/molecules/tooltip/tooltip.test.tsx')
-rw-r--r--src/components/molecules/tooltip/tooltip.test.tsx40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/components/molecules/tooltip/tooltip.test.tsx b/src/components/molecules/tooltip/tooltip.test.tsx
deleted file mode 100644
index 25a1614..0000000
--- a/src/components/molecules/tooltip/tooltip.test.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { describe, expect, it } from '@jest/globals';
-import { render, screen } from '../../../../tests/utils';
-import { Tooltip } from './tooltip';
-
-const title = 'A custom title';
-const children =
- 'Labore ullam delectus sit modi quam dolores. Ratione id sint aliquid facilis ipsum. Unde necessitatibus provident minus.';
-
-describe('Tooltip', () => {
- it('renders a title and a body', () => {
- render(<Tooltip heading={title}>{children}</Tooltip>);
-
- expect(screen.getByText(title)).toBeInTheDocument();
- expect(screen.getByText(children)).toBeInTheDocument();
- });
-
- it('can render a hidden modal', () => {
- render(
- <Tooltip heading={title} isOpen={false}>
- {children}
- </Tooltip>
- );
-
- // Neither toBeVisible or toHaveStyle are working.
- //expect(screen.getByText(children)).not.toBeVisible();
- //expect(screen.getByText(children)).toHaveStyle({ visibility: 'hidden' });
- expect(screen.getByText(children)).toHaveClass('tooltip--hidden');
- });
-
- it('can render a visible modal', () => {
- render(
- <Tooltip heading={title} isOpen>
- {children}
- </Tooltip>
- );
-
- expect(screen.getByText(children)).toBeVisible();
- expect(screen.getByText(children)).toHaveStyle({ visibility: 'visible' });
- });
-});