diff --git a/src/components/Timestamp/Timestamp.test.tsx b/src/components/Timestamp/Timestamp.test.tsx index 4948a1c..790aea1 100644 --- a/src/components/Timestamp/Timestamp.test.tsx +++ b/src/components/Timestamp/Timestamp.test.tsx @@ -1,21 +1,21 @@ -import { shallow } from 'enzyme'; import * as React from 'react'; +import { render, screen } from '@testing-library/react'; +import { describe, expect, it } from 'vitest'; + import Timestamp from './Timestamp'; const setup = (value = '') => { - return shallow() + return render() }; -describe('Timestamp component', () => { +describe('Timestamp', () => { it('renders without crashing', () => { const wrapper = setup(); expect(wrapper).not.toBe(null) }); it('should be able to render properly value passed as prop', () => { - let wrapper = setup(); - expect(wrapper.text()).toBe(''); - wrapper = setup('11:22'); - expect(wrapper.text()).toBe('11:22'); + setup('11:22'); + expect(screen.getByText('11:22')).toBeVisible(); }); });