From 028f6c0d3f23543634a16ebc135c884b0316cdd7 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Mon, 4 Oct 2021 10:56:30 -0300 Subject: [PATCH] chore: Moves spec files to the src folder - iteration 6 (#16935) --- .../components/ColumnTypeLabel_spec.tsx | 87 ------------------- .../middleware/asyncEvent.test.ts} | 0 .../middleware/logger.test.js} | 0 .../profile/components/App.test.tsx} | 0 .../components/CreatedContent.test.tsx} | 0 .../profile/components/Favorites.test.tsx} | 0 .../components/RecentActivity.test.tsx} | 0 .../profile/components/Security.test.tsx} | 0 .../profile/components/UserInfo.test.tsx} | 0 .../profile/components}/fixtures.tsx | 0 10 files changed, 87 deletions(-) delete mode 100644 superset-frontend/spec/javascripts/components/ColumnTypeLabel_spec.tsx rename superset-frontend/{spec/javascripts/middleware/asyncEvent_spec.ts => src/middleware/asyncEvent.test.ts} (100%) rename superset-frontend/{spec/javascripts/middleware/logger_spec.js => src/middleware/logger.test.js} (100%) rename superset-frontend/{spec/javascripts/profile/App_spec.tsx => src/profile/components/App.test.tsx} (100%) rename superset-frontend/{spec/javascripts/profile/CreatedContent_spec.tsx => src/profile/components/CreatedContent.test.tsx} (100%) rename superset-frontend/{spec/javascripts/profile/Favorites_spec.tsx => src/profile/components/Favorites.test.tsx} (100%) rename superset-frontend/{spec/javascripts/profile/RecentActivity_spec.tsx => src/profile/components/RecentActivity.test.tsx} (100%) rename superset-frontend/{spec/javascripts/profile/Security_spec.tsx => src/profile/components/Security.test.tsx} (100%) rename superset-frontend/{spec/javascripts/profile/UserInfo_spec.tsx => src/profile/components/UserInfo.test.tsx} (100%) rename superset-frontend/{spec/javascripts/profile => src/profile/components}/fixtures.tsx (100%) diff --git a/superset-frontend/spec/javascripts/components/ColumnTypeLabel_spec.tsx b/superset-frontend/spec/javascripts/components/ColumnTypeLabel_spec.tsx deleted file mode 100644 index 42aab98090..0000000000 --- a/superset-frontend/spec/javascripts/components/ColumnTypeLabel_spec.tsx +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import React from 'react'; -import { render, screen, cleanup } from 'spec/helpers/testing-library'; - -import { - ColumnTypeLabel, - ColumnTypeLabelProps, -} from '@superset-ui/chart-controls'; -import { GenericDataType } from '@superset-ui/core'; - -const defaultProps = { - type: GenericDataType.STRING, -}; - -const setup = (overrides?: ColumnTypeLabelProps) => ( -
- -
-); - -describe('ColumnOption RTL', () => { - afterEach(cleanup); - it('is a valid element', () => { - expect(React.isValidElement()).toBe( - true, - ); - }); - - it('string type shows ABC icon', () => { - render(setup(defaultProps)); - - const labelIcon = screen.getByText(/abc/i); - expect(labelIcon.innerHTML).toMatch(/abc/i); - }); - - it('int type shows # icon', () => { - render(setup({ type: GenericDataType.NUMERIC })); - - const labelIcon = screen.getByText(/#/i); - expect(labelIcon.innerHTML).toMatch(/#/i); - }); - - it('bool type shows T/F icon', () => { - render(setup({ type: GenericDataType.BOOLEAN })); - - const labelIcon = screen.getByText(/t\/f/i); - expect(labelIcon.innerHTML).toMatch(/t\/f/i); - }); - - it('expression type shows function icon', () => { - render(setup({ type: 'expression' })); - - const labelIcon = screen.getByText('ƒ'); - expect(labelIcon.innerHTML).toMatch('ƒ'); - }); - - it('unknown type shows question mark', () => { - render(setup({ type: undefined })); - - const labelIcon = screen.getByText('?'); - expect(labelIcon.innerHTML).toMatch('?'); - }); - - it('datetime type displays', () => { - const rendered = render(setup({ type: GenericDataType.TEMPORAL })); - - const clockIcon = rendered.container.querySelector('.fa-clock-o'); - expect(clockIcon).toBeVisible(); - }); -}); diff --git a/superset-frontend/spec/javascripts/middleware/asyncEvent_spec.ts b/superset-frontend/src/middleware/asyncEvent.test.ts similarity index 100% rename from superset-frontend/spec/javascripts/middleware/asyncEvent_spec.ts rename to superset-frontend/src/middleware/asyncEvent.test.ts diff --git a/superset-frontend/spec/javascripts/middleware/logger_spec.js b/superset-frontend/src/middleware/logger.test.js similarity index 100% rename from superset-frontend/spec/javascripts/middleware/logger_spec.js rename to superset-frontend/src/middleware/logger.test.js diff --git a/superset-frontend/spec/javascripts/profile/App_spec.tsx b/superset-frontend/src/profile/components/App.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/profile/App_spec.tsx rename to superset-frontend/src/profile/components/App.test.tsx diff --git a/superset-frontend/spec/javascripts/profile/CreatedContent_spec.tsx b/superset-frontend/src/profile/components/CreatedContent.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/profile/CreatedContent_spec.tsx rename to superset-frontend/src/profile/components/CreatedContent.test.tsx diff --git a/superset-frontend/spec/javascripts/profile/Favorites_spec.tsx b/superset-frontend/src/profile/components/Favorites.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/profile/Favorites_spec.tsx rename to superset-frontend/src/profile/components/Favorites.test.tsx diff --git a/superset-frontend/spec/javascripts/profile/RecentActivity_spec.tsx b/superset-frontend/src/profile/components/RecentActivity.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/profile/RecentActivity_spec.tsx rename to superset-frontend/src/profile/components/RecentActivity.test.tsx diff --git a/superset-frontend/spec/javascripts/profile/Security_spec.tsx b/superset-frontend/src/profile/components/Security.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/profile/Security_spec.tsx rename to superset-frontend/src/profile/components/Security.test.tsx diff --git a/superset-frontend/spec/javascripts/profile/UserInfo_spec.tsx b/superset-frontend/src/profile/components/UserInfo.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/profile/UserInfo_spec.tsx rename to superset-frontend/src/profile/components/UserInfo.test.tsx diff --git a/superset-frontend/spec/javascripts/profile/fixtures.tsx b/superset-frontend/src/profile/components/fixtures.tsx similarity index 100% rename from superset-frontend/spec/javascripts/profile/fixtures.tsx rename to superset-frontend/src/profile/components/fixtures.tsx