import {mountWithTheme} from 'sentry-test/enzyme'; import ApiTokenRow from 'sentry/views/settings/account/apiTokenRow'; describe('ApiTokenRow', function () { it('renders', function () { const wrapper = mountWithTheme( {}} token={TestStubs.ApiToken()} />, TestStubs.routerContext() ); // Should be loading expect(wrapper).toSnapshot(); }); it('calls onRemove callback when trash can is clicked', function () { const cb = jest.fn(); const wrapper = mountWithTheme( , TestStubs.routerContext() ); wrapper.find('Button').simulate('click'); expect(cb).toHaveBeenCalled(); }); });