Browse Source

test(js): Remove mocking of jQuery (#23607)

We are basically no longer using it
Evan Purkhiser 4 years ago
parent
commit
6895c6564a

+ 0 - 14
src/sentry/static/sentry/app/__mocks__/jquery.tsx

@@ -1,14 +0,0 @@
-const jq = {
-  tooltip: () => jq,
-  on: () => jq,
-  off: () => jq,
-  unbind: () => jq,
-  ajaxError: () => jq,
-  simpleSlider: () => jq,
-  addClass: () => jq,
-  find: () => jq,
-} as Partial<JQuery>;
-
-const jqMock = () => jq;
-
-export default jqMock;

+ 0 - 3
tests/js/setup.js

@@ -146,9 +146,6 @@ jest.mock('popper.js', () => {
   };
 });
 
-// We generally use actual jQuery, and jest mocks takes precedence over node_modules.
-jest.unmock('jquery');
-
 /**
  * Test Globals
  */

+ 0 - 2
tests/js/spec/components/contextPickerModal.spec.jsx

@@ -8,8 +8,6 @@ import OrganizationsStore from 'app/stores/organizationsStore';
 import OrganizationStore from 'app/stores/organizationStore';
 import ProjectsStore from 'app/stores/projectsStore';
 
-jest.mock('jquery');
-
 describe('ContextPickerModal', function () {
   let project, project2, org, org2;
   const onFinish = jest.fn();

+ 0 - 2
tests/js/spec/components/forms/numberField.spec.jsx

@@ -5,8 +5,6 @@ import {mount, mountWithTheme} from 'sentry-test/enzyme';
 import {NumberField} from 'app/components/forms';
 import Form from 'app/components/forms/form';
 
-jest.mock('jquery');
-
 describe('NumberField', function () {
   describe('render()', function () {
     it('renders', function () {

+ 0 - 1
tests/js/spec/components/modals/commandPaletteModal.spec.jsx

@@ -7,7 +7,6 @@ import {navigateTo} from 'app/actionCreators/navigation';
 import FormSearchStore from 'app/stores/formSearchStore';
 import App from 'app/views/app';
 
-jest.mock('jquery');
 jest.mock('app/actionCreators/formSearch');
 jest.mock('app/actionCreators/navigation');
 

+ 0 - 2
tests/js/spec/components/modals/sudoModal.spec.jsx

@@ -6,8 +6,6 @@ import {Client} from 'app/api';
 import ConfigStore from 'app/stores/configStore';
 import App from 'app/views/app';
 
-jest.mock('jquery');
-
 describe('Sudo Modal', function () {
   beforeEach(function () {
     Client.clearMockResponses();

+ 0 - 2
tests/js/spec/views/acceptProjectTransfer.spec.jsx

@@ -4,8 +4,6 @@ import {mountWithTheme} from 'sentry-test/enzyme';
 
 import AcceptProjectTransfer from 'app/views/acceptProjectTransfer';
 
-jest.mock('jquery');
-
 describe('AcceptProjectTransfer', function () {
   let getMock;
   let postMock;

+ 0 - 1
tests/js/spec/views/accountDetail.spec.jsx

@@ -4,7 +4,6 @@ import {mountWithTheme} from 'sentry-test/enzyme';
 
 import AccountDetails from 'app/views/settings/account/accountDetails';
 
-jest.mock('jquery');
 jest.mock('scroll-to-element', () => 'scroll-to-element');
 
 const mockUserDetails = params => {

+ 0 - 2
tests/js/spec/views/app.spec.jsx

@@ -5,8 +5,6 @@ import {mount} from 'sentry-test/enzyme';
 import ConfigStore from 'app/stores/configStore';
 import App from 'app/views/app';
 
-jest.mock('jquery');
-
 describe('App', function () {
   beforeEach(function () {
     MockApiClient.addMockResponse({

+ 0 - 1
tests/js/spec/views/ownershipInput.spec.jsx

@@ -6,7 +6,6 @@ import {findOption, openMenu} from 'sentry-test/select';
 import MemberListStore from 'app/stores/memberListStore';
 import OwnerInput from 'app/views/settings/project/projectOwnership/ownerInput';
 
-jest.mock('jquery');
 describe('Project Ownership Input', function () {
   let org;
   let project;

Some files were not shown because too many files changed in this diff