Ver Fonte

[frontend] Drop flaky tests from ko.quickQueryContext

The quick query context is unused and broken at the moment, but keeping it as reference for when we create a proper Vue version.
Johan Ahlen há 4 anos atrás
pai
commit
95cde8a3ca

+ 0 - 58
desktop/core/src/desktop/js/ko/components/contextPopover/__snapshots__/ko.quickQueryContext.test.js.snap

@@ -1,58 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`ko.quickQueryContext.js should render component 1`] = `
-"<div data-bind=\\"descendantsComplete: descendantsComplete, component: { name: &quot;quick-query-context&quot;, params: params }\\"><div class=\\"context-popover-flex-fill\\" style=\\"overflow: auto;\\">
-  <div style=\\"display: inline-block\\" data-bind=\\"
-    component: {
-      name: 'hue-drop-down',
-      params: {
-        value: connector,
-        labelAttribute: 'displayName',
-        entries: availableConnectors,
-        linkTitle: 'Active connector'
-      }
-    }
-  \\"><a class=\\"inactive-action hue-drop-down-active\\" href=\\"javascript:void(0)\\" data-bind=\\"toggle: dropDownVisible, css: { 'blue': dropDownVisible }\\">
-    <!-- ko if: icon --><!-- /ko -->
-    <!-- ko if: !noLabel && value -->
-    <span class=\\"hue-drop-down-selected\\" data-bind=\\"text: value() &amp;&amp; typeof value()[labelAttribute] !== 'undefined' ? value()[labelAttribute] : value(), visible: ! dropDownVisible() || !searchable, attr: { 'title': titleTooltip }\\" title=\\"[object Object]\\">[object Object]</span>
-    <!-- /ko -->
-    <i class=\\"fa fa-caret-down\\"></i>
-  </a><input class=\\"hue-drop-down-input\\" type=\\"text\\" data-bind=\\"textInput: filter, attr: { 'placeHolder': inputPlaceHolder }, visible: dropDownVisible, style: { color: filterEdited() ? '#000' : '#AAA', 'min-height': '22px', 'margin-left': '10px' }\\" style=\\"display: none; color: rgb(170, 170, 170); min-height: 22px; margin-left: 10px;\\"><i class=\\"fa fa-caret-down\\"></i><div class=\\"hue-drop-down-container\\" data-bind=\\"css: { 'open' : dropDownVisible, 'hue-drop-down-fixed': fixedPosition, 'hue-drop-down-container-searchable': searchable }, dropDownKeyUp: { onEsc: onEsc, onEnter: onEnter, dropDownVisible: dropDownVisible }\\">
-    <div style=\\"overflow-y: auto;\\" class=\\"dropdown-menu\\" data-bind=\\"visible: filteredEntries().length > 0\\">
-      <!-- ko if: foreachVisible --><!-- /ko -->
-      <!-- ko ifnot: foreachVisible -->
-      <ul class=\\"hue-inner-drop-down\\" data-bind=\\"foreach: filteredEntries\\">
-        <!-- ko if: typeof $data.divider !== 'undefined' && $data.divider --><!-- /ko -->
-        <!-- ko if: typeof $data.divider === 'undefined' || !$data.divider -->
-        <li><a href=\\"javascript:void(0)\\" data-bind=\\"text: $data &amp;&amp; typeof $data[$parent.labelAttribute] !== 'undefined' ? $data[$parent.labelAttribute] : $data, click: function () { let previous = $parent.value(); $parent.value($data); $parent.onSelect($data, previous); }\\">[object Object]</a></li>
-        <!-- /ko -->
-      </ul>
-      <!-- /ko -->
-    </div>
-  </div></div>
-  <!-- ko if: connector() -->
-    <div class=\\"margin-left-10\\" style=\\"display: inline-block\\" data-bind=\\"
-      component: {
-        name: 'hue-context-selector',
-        params: {
-          connector: connector,
-          compute: compute,
-          namespace: namespace,
-          availableDatabases: availableDatabases,
-          database: database,
-          hideLabels: true
-        }
-      }
-    \\"><i class=\\"fa fa-spinner fa-spin muted\\"></i><div class=\\"inline-block\\" style=\\"display: none;\\" data-bind=\\"visible: !loadingContext()\\">
-    <!-- ko if: window.HAS_MULTI_CLUSTER --><!-- /ko -->
-
-    <!-- ko if: availableDatabases().length > 0 && !hideDatabases--><!-- /ko -->
-    <!-- ko if: availableDatabases().length === 0  && !hideDatabases -->
-    <span class=\\"editor-header-title\\"><i class=\\"fa fa-warning\\"></i> No databases found</span>
-    <!-- /ko -->
-  </div></div>
-  <!-- /ko -->
-  <!-- ko ifnot: loadingContext --><!-- /ko -->
-</div></div>"
-`;

+ 0 - 51
desktop/core/src/desktop/js/ko/components/contextPopover/ko.quickQueryContext.test.js

@@ -1,51 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. 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 { koSetup } from 'jest/koTestUtils';
-import { NAME } from './ko.quickQueryContext';
-import * as hueConfig from 'utils/hueConfig';
-import apiHelper from 'api/apiHelper';
-
-import $ from 'jquery';
-
-describe('ko.quickQueryContext.js', () => {
-  const setup = koSetup();
-
-  it('should render component', async () => {
-    const connectorsSpy = jest
-      .spyOn(hueConfig, 'filterEditorConnectors')
-      .mockImplementation(() => [{ id: 'impala' }]);
-    const computeSpy = jest
-      .spyOn(apiHelper, 'fetchContextComputes')
-      .mockImplementation(() => $.Deferred().resolve({}));
-    const fetchContextNamespaces = jest
-      .spyOn(apiHelper, 'fetchContextNamespaces')
-      .mockImplementation(() => $.Deferred().resolve({}));
-
-    const element = await setup.renderComponent(NAME, {});
-
-    expect(connectorsSpy).toHaveBeenCalled();
-    expect(computeSpy).toHaveBeenCalled();
-    expect(fetchContextNamespaces).toHaveBeenCalled();
-
-    expect(
-      element.innerHTML.replace(/[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}/gi, 'uuid-uuid')
-    ).toMatchSnapshot();
-
-    connectorsSpy.mockRestore();
-    connectorsSpy.mockClear();
-  });
-});