import {render, screen} from 'sentry-test/reactTestingLibrary'; import HotkeysLabel from 'sentry/components/hotkeysLabel'; describe('HotkeysLabel', function () { it('ctrl+alt+delete mac', function () { render(); expect(screen.getByText('⌃')).toBeInTheDocument(); expect(screen.getByText('⌥')).toBeInTheDocument(); expect(screen.getByText('DELETE')).toBeInTheDocument(); }); it('ctrl+alt+delete windows', function () { render(); expect(screen.getByText('CTRL')).toBeInTheDocument(); expect(screen.getByText('ALT')).toBeInTheDocument(); expect(screen.getByText('DELETE')).toBeInTheDocument(); }); it('falls back when not on mac', function () { render(); expect(screen.queryByText('⌘')).not.toBeInTheDocument(); expect(screen.queryByText('CMD')).not.toBeInTheDocument(); expect(screen.getByText('ALT')).toBeInTheDocument(); }); it('does not render at all without fallback', function () { render(); expect(screen.queryByText('⌘')).not.toBeInTheDocument(); expect(screen.queryByText('L')).not.toBeInTheDocument(); expect(screen.queryByText('ALT')).not.toBeInTheDocument(); }); it('takes just a string', function () { render(); expect(screen.getByText('ALT')).toBeInTheDocument(); }); });