import {render, screen} from 'sentry-test/reactTestingLibrary'; import FeatureBadge from 'sentry/components/featureBadge'; describe('FeatureBadge', function () { it('auto-hides when expired', function () { const {rerender} = render( ); expect(screen.getByText('new')).toBeInTheDocument(); rerender( ); expect(screen.queryByText('new')).not.toBeInTheDocument(); }); it('shows before expiry date', function () { // One hour from 'now'. const expires = new Date(Date.now() + 1000 * 60 * 60); render(); expect(screen.getByText('new')).toBeInTheDocument(); }); });