Эх сурвалжийг харах

[frontend] Remove flaky test

It's a pretty useless test that's likely hitting some timing issue, better to extend the test once we convert it to Vue.
Johan Ahlen 4 жил өмнө
parent
commit
853b237d05

+ 0 - 198
desktop/core/src/desktop/js/ko/components/__snapshots__/ko.catalogEntriesList.test.js.snap

@@ -1,198 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`ko.catalogEntriesList.js should render component 1`] = `
-"<div data-bind=\\"descendantsComplete: descendantsComplete, component: { name: &quot;catalog-entries-list&quot;, params: params }\\"><script type=\\"text/html\\" id=\\"entries-table-td-description\\">
-    <td data-bind=\\"attr: { 'title': comment }\\">
-    <!-- ko if: $parent.editableDescriptions && !window.HAS_READ_ONLY_CATALOG -->
-      <div class=\\"hue-catalog-entries-table-desc\\" data-bind=\\"visibleOnHover: { selector: '.editable-inline-action' }\\">
-        <div data-bind=\\"editable: comment, editableOptions: {
-          mode: 'inline',
-          enabled: true,
-          type: 'textarea',
-          showbuttons: 'bottom',
-          inputclass: 'hue-table-browser-desc-input',
-          toggle: 'manual',
-          toggleElement: '.toggle-editable',
-          placeholder: 'Add a description...',
-          emptytext: 'Add a description...',
-          inputclass: 'hue-catalog-entries-table-desc-input',
-          rows: 6,
-          save: saveComment,
-          inlineEditAction: { editClass: 'toggle-editable editable-inline-action' },
-          multiLineEllipsis: { overflowHeight: '40px', expandable: true, expandActionClass: 'editable-inline-action' }
-        }\\">Add a description...</div>
-      </div>
-    <!-- /ko -->
-    <!-- ko if: !$parent.editableDescriptions || window.HAS_READ_ONLY_CATALOG -->
-      <div class=\\"entries-table-description\\" data-bind=\\"text: comment, multiLineEllipsis\\"></div>
-    <!-- /ko -->
-    </td>
-  </script><script type=\\"text/html\\" id=\\"entries-table-tbody-no-entries\\">
-    <tbody>
-      <tr>
-        <td style=\\"font-style: italic;\\" data-bind=\\"attr: { 'colspan': colCount + (typeof $component.selectedEntries !== 'undefined' ? 1 : 0) + ($component.contextPopoverEnabled ? 1 : 0) }\\">
-          <!-- ko ifnot: hasErrors -->
-          No entries found
-          <!-- /ko -->
-          <!-- ko if: hasErrors -->
-          Error loading entries
-          <!-- /ko -->
-        </td>
-      </tr>
-    </tbody>
-  </script><script type=\\"text/html\\" id=\\"entries-table-shared-headers\\">
-    <!-- ko if: typeof selectedEntries !== 'undefined' -->
-    <th width=\\"1%\\" class=\\"select-column\\"><div class=\\"hue-checkbox fa\\" data-bind=\\"hueCheckAll: { allValues: filteredEntries, selectedValues: selectedEntries }\\"></div></th>
-    <!-- /ko -->
-    <!-- ko if: contextPopoverEnabled -->
-    <th width=\\"1%\\">&nbsp;</th>
-    <!-- /ko -->
-  </script><script type=\\"text/html\\" id=\\"entries-table-shared-columns\\">
-    <!-- ko if: typeof $parent.selectedEntries !== 'undefined' -->
-    <td width=\\"1%\\" class=\\"select-column\\"><div class=\\"hue-checkbox fa\\" data-bind=\\"multiCheck: '#entryTable', value: $data, hueChecked: $parent.selectedEntries\\"></div></td>
-    <!-- /ko -->
-    <!-- ko if: $parent.contextPopoverEnabled -->
-    <td width=\\"1%\\"><a href=\\"javascript: void(0);\\" data-bind=\\"click: showContextPopover\\"><i class=\\"fa fa-info\\"></i></a></td>
-    <!-- /ko -->
-  </script><div class=\\"context-popover-inline-autocomplete\\">
-    <div class=\\"context-popover-sample-filter\\">
-      <!-- ko component: {
-        name: 'inline-autocomplete',
-        params: {
-          querySpec: querySpec,
-          facets: facets,
-          knownFacetValues: knownFacetValues,
-          autocompleteFromEntries: autocompleteFromEntries
-        }
-      } --><div class=\\"inline-autocomp-container\\">
-    <div>
-      <!-- ko if: showMagnify --><!-- /ko-->
-      <form autocomplete=\\"off\\">
-        <input class=\\"inline-autocomp-input\\" autocorrect=\\"off\\" autocomplete=\\"do-not-autocomplete\\" autocapitalize=\\"off\\" spellcheck=\\"false\\" type=\\"text\\" data-bind=\\"
-          attr: { 'placeHolder' : hasFocus() ? '' : placeHolder },
-          textInput: searchInput,
-          hasFocus: hasFocus,
-          clearable: { value: searchInput, onClear: onClear },
-          css: { 'inline-autocomp-magnify-input': showMagnify }\\" placeholder=\\"Filter...\\">
-        <input class=\\"inline-autocomp-autocomp\\" disabled=\\"\\" type=\\"text\\" autocomplete=\\"do-not-autocomplete\\" data-bind=\\"
-          value: inlineAutocomplete,
-          css: { 'inline-autocomp-magnify-input': showMagnify }\\">
-      </form>
-    </div>
-  </div><div class=\\"hue-drop-down-container hue-drop-down-fixed\\" data-bind=\\"event: { 'mousedown': facetDropDownMouseDown }, css: { 'open' : facetDropDownVisible() }, dropDownKeyUp: { onEsc: facetDropDownOnEsc, onEnter: facetDropDownOnEnter, onSelected: facetDropDownOnSelected, dropDownVisible: facetDropDownVisible }\\">
-    <div class=\\"dropdown-menu\\" style=\\"overflow-y: auto; display: none;\\" data-bind=\\"visible: facetSuggestions().length > 0\\">
-      <ul class=\\"hue-inner-drop-down\\" data-bind=\\"foreach: facetSuggestions\\"></ul>
-    </div>
-  </div><!-- /ko -->
-    </div>
-  </div><div class=\\"catalog-entries-list-container\\">
-    <!-- ko hueSpinner: { spin: loading, center: true, size: 'xlarge' } --><!-- /ko -->
-    <!-- ko if: !loading() && catalogEntry().isSource() --><!-- /ko -->
-
-    <!-- ko if: !loading() && catalogEntry().isDatabase() --><!-- /ko -->
-
-    <!-- ko if: !loading() && (catalogEntry().isTableOrView() || catalogEntry().isComplex()) --><!-- /ko -->
-
-    <!-- ko if: !loading() && catalogEntry().isField() && !catalogEntry().isComplex() -->
-    <!-- ko component: { name: 'field-samples', params: {
-        catalogEntry: catalogEntry,
-        onSampleClick: onSampleClick,
-        refreshSampleInterval: refreshSampleInterval
-      }} --><div class=\\"context-popover-inline-autocomplete\\" style=\\"display: flex\\">
-    <div class=\\"context-popover-sample-filter\\">
-      <!-- ko component: {
-        name: 'inline-autocomplete',
-        params: {
-          querySpec: querySpec,
-          autocompleteFromEntries: autocompleteFromEntries
-        }
-      } --><div class=\\"inline-autocomp-container\\">
-    <div>
-      <!-- ko if: showMagnify --><!-- /ko-->
-      <form autocomplete=\\"off\\">
-        <input class=\\"inline-autocomp-input\\" autocorrect=\\"off\\" autocomplete=\\"do-not-autocomplete\\" autocapitalize=\\"off\\" spellcheck=\\"false\\" type=\\"text\\" data-bind=\\"
-          attr: { 'placeHolder' : hasFocus() ? '' : placeHolder },
-          textInput: searchInput,
-          hasFocus: hasFocus,
-          clearable: { value: searchInput, onClear: onClear },
-          css: { 'inline-autocomp-magnify-input': showMagnify }\\" placeholder=\\"Filter...\\">
-        <input class=\\"inline-autocomp-autocomp\\" disabled=\\"\\" type=\\"text\\" autocomplete=\\"do-not-autocomplete\\" data-bind=\\"
-          value: inlineAutocomplete,
-          css: { 'inline-autocomp-magnify-input': showMagnify }\\">
-      </form>
-    </div>
-  </div><div class=\\"hue-drop-down-container hue-drop-down-fixed\\" data-bind=\\"event: { 'mousedown': facetDropDownMouseDown }, css: { 'open' : facetDropDownVisible() }, dropDownKeyUp: { onEsc: facetDropDownOnEsc, onEnter: facetDropDownOnEnter, onSelected: facetDropDownOnSelected, dropDownVisible: facetDropDownVisible }\\">
-    <div class=\\"dropdown-menu\\" style=\\"overflow-y: auto; display: none;\\" data-bind=\\"visible: facetSuggestions().length > 0\\">
-      <ul class=\\"hue-inner-drop-down\\" data-bind=\\"foreach: facetSuggestions\\"></ul>
-    </div>
-  </div><!-- /ko -->
-    </div>
-    <!-- ko if: showOperations -->
-    <div class=\\"context-popover-sample-controls\\">
-      <div class=\\"margin-left-10 inline-block\\" data-bind=\\"component: { name: 'hue-drop-down', params: { value: operation, entries: operations } }\\"><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': value() &amp;&amp; typeof value()[labelAttribute] !== 'undefined' ? value()[labelAttribute] : value() }\\" title=\\"default\\">default</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' }\\" placeholder=\\"default\\" 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); }\\">default</a></li>
-        <!-- /ko -->
-      
-        <!-- 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); }\\">distinct</a></li>
-        <!-- /ko -->
-      
-        <!-- 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); }\\">max</a></li>
-        <!-- /ko -->
-      
-        <!-- 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); }\\">min</a></li>
-        <!-- /ko -->
-      </ul>
-      <!-- /ko -->
-    </div>
-  </div></div>
-      <div class=\\"margin-left-10 inactive-action inline-block\\">
-        <!-- ko if: loadingSamples() || refreshSampleEnabled() --><!-- /ko -->
-        <!-- ko if: !loadingSamples() && !refreshSampleEnabled() -->
-        <a href=\\"javascript:void(0);\\" data-bind=\\"click: function () { loadSamples(true) }\\"><i class=\\"fa fa-play\\"></i></a>
-        <!-- /ko -->
-      </div>
-    </div>
-    <!-- /ko -->
-  </div><table class=\\"table table-condensed table-nowrap\\">
-    <thead>
-    <tr>
-      <th>Sample</th>
-    </tr>
-    </thead>
-    <!-- ko if: loadingSamples() && (!refreshSampleEnabled() || (refreshSampleEnabled() && columnSamples().length === 0))  --><!-- /ko -->
-
-    <!-- ko if: !loadingSamples() || (refreshSampleEnabled() && columnSamples().length > 0)  -->
-    <tbody data-bind=\\"foreach: filteredColumnSamples\\"></tbody>
-    <!-- ko if: filteredColumnSamples().length === 0 -->
-    <tbody>
-    <tr>
-      <!-- ko ifnot: hasErrors --><!-- /ko -->
-      <!-- ko if: hasErrors -->
-      <td style=\\"font-style: italic;\\">Error loading samples</td>
-      <!-- /ko -->
-    </tr>
-    </tbody>
-    <!-- /ko -->
-    <!-- /ko -->
-  </table><!-- /ko -->
-    <!-- /ko -->
-  </div></div>"
-`;

+ 0 - 96
desktop/core/src/desktop/js/ko/components/ko.catalogEntriesList.test.js

@@ -1,96 +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 { CancellablePromise } from '../../api/cancellablePromise';
-import { NAME } from './ko.catalogEntriesList';
-
-import 'ko/components/ko.inlineAutocomplete';
-import 'ko/components/ko.fieldSamples';
-import 'ko/components/ko.dropDown';
-
-describe('ko.catalogEntriesList.js', () => {
-  const setup = koSetup();
-
-  it('should render component', async () => {
-    const element = await setup.renderComponent(NAME, {
-      catalogEntry: {
-        compute: { id: 'foo' },
-        dataCatalog: {},
-        definition: {},
-        isTemporary: false,
-        name: 'foo',
-        namespace: { id: 'foo' },
-        path: ['foo'],
-        addNavigatorTags: () => Promise.reject(),
-        canHaveNavigatorMetadata: () => false,
-        clearCache: () => Promise.resolve(),
-        deleteNavigatorTags: () => Promise.reject(),
-        getAnalysis: () => CancellablePromise.reject(),
-        getChildren: () => CancellablePromise.resolve([]),
-        getComment: () => CancellablePromise.resolve(''),
-        getCommentObservable: () => undefined,
-        getConnector: () => {
-          id: 'impala';
-        },
-        getDialect: () => 'impala',
-        getDisplayName: () => 'foo',
-        getIndex: () => 0,
-        getNavigatorMeta: () => CancellablePromise.reject(),
-        getOptimizerMeta: () => CancellablePromise.reject(),
-        getParent: () => Promise.reject(),
-        getPartitions: () => CancellablePromise.reject(),
-        getQualifiedPath: () => '',
-        getRawType: () => 'int',
-        getResolvedComment: () => '',
-        getSample: () => CancellablePromise.reject(),
-        getSourceMeta: () => CancellablePromise.reject(),
-        getTitle: () => 'foo',
-        getTopAggs: () => CancellablePromise.reject(),
-        getTopFilters: () => CancellablePromise.reject(),
-        getTopJoins: () => CancellablePromise.reject(),
-        getType: () => 'int',
-        hasPossibleChildren: () => false,
-        hasResolvedComment: () => false,
-        isArray: () => false,
-        isColumn: () => true,
-        isComplex: () => false,
-        isDatabase: () => false,
-        isField: () => true,
-        isForeignKey: () => false,
-        isKey: () => true,
-        isMapValue: () => false,
-        isMap: () => false,
-        isModel: () => false,
-        isPartitionKey: () => false,
-        isPrimaryKey: () => false,
-        isSource: () => false,
-        isTable: () => false,
-        isTableOrView: () => false,
-        isView: () => false,
-        loadNavigatorMetaForChildren: () => CancellablePromise.reject(),
-        loadOptimizerPopularityForChildren: () => CancellablePromise.reject(),
-        reset: () => undefined,
-        save: () => Promise.resolve(),
-        saveLater: () => undefined,
-        setComment: () => Promise.resolve('')
-      }
-    });
-    await setup.waitForKoUpdate();
-
-    expect(element.innerHTML).toMatchSnapshot();
-  });
-});