').addClass(`${CSS_BASE}__buttons`);
$container.append($label).append($buttons);
this.$elem.append($container);
- this.$statusDiv = $('
').addClass('kb-download-panel__status');
+ this.$statusDiv = $('
').addClass(`${CSS_BASE}__status`);
this.$elem.append(this.$statusDiv.hide());
},
renderDownloadButtons: function () {
const downloaders = this.prepareDownloaders(this.type);
- const $btnPanel = this.$elem.find('.kb-download-panel__buttons');
+ const $btnPanel = this.$elem.find(`.${CSS_BASE}__buttons`);
downloaders.forEach((dlInfo) => {
if (dlInfo.name.toLocaleLowerCase() === 'staging') {
$btnPanel.append(
@@ -259,7 +260,7 @@ define([
},
showMessage: function (msg) {
- this.$statusDiv.empty().append(msg);
+ this.$statusDiv.empty().append(msg).show();
},
showError: function (error) {
@@ -272,11 +273,14 @@ define([
}
// error is final state, so reactivate!
this.$elem.find('.kb-data-list-btn').prop('disabled', false);
- this.$statusDiv.empty().append(
- $('')
- .addClass('kb-download-panel__status_error')
- .append('Error: ' + error)
- );
+ this.$statusDiv
+ .empty()
+ .append(
+ $('')
+ .addClass(`${CSS_BASE}__status_error`)
+ .append('Error: ' + error)
+ )
+ .show();
},
stopTimer: function () {
diff --git a/test/unit/spec/common/cellComponents/tabs/infoTab-Spec.js b/test/unit/spec/common/cellComponents/tabs/infoTab-Spec.js
index 27e282fed6..3c316e5a55 100644
--- a/test/unit/spec/common/cellComponents/tabs/infoTab-Spec.js
+++ b/test/unit/spec/common/cellComponents/tabs/infoTab-Spec.js
@@ -3,8 +3,6 @@ define(['common/cellComponents/tabs/infoTab', 'common/props', 'testUtil'], (
Props,
TestUtil
) => {
- 'use strict';
-
describe('The App Info Tab module', () => {
it('loads', () => {
expect(InfoTab).not.toBe(null);
@@ -86,6 +84,13 @@ define(['common/cellComponents/tabs/infoTab', 'common/props', 'testUtil'], (
ui_name: 'Adapters',
id: 'adapters',
},
+ {
+ text_options: {
+ valid_ws_types: ['*', 'SomeModule.SomeType'],
+ },
+ ui_name: 'Any old object',
+ id: 'any_old_object',
+ },
],
},
tag: APP.ONE.TAG,
@@ -305,6 +310,19 @@ define(['common/cellComponents/tabs/infoTab', 'common/props', 'testUtil'], (
).toBe(appData[APP.ONE.ID].app.spec.parameters[1].ui_name);
});
+ it('renders no links for a parameter than can be a wildcard type', () => {
+ const paramThree = container.querySelectorAll(
+ `.${cssBaseClass}__list_item--params`
+ )[2];
+ expect(
+ paramThree.querySelector(`.${cssBaseClass}__param--id`).textContent
+ ).toBe(appData[APP.ONE.ID].app.spec.parameters[2].id);
+ expect(
+ paramThree.querySelector(`.${cssBaseClass}__param--ui-name`).textContent
+ ).toBe(appData[APP.ONE.ID].app.spec.parameters[2].ui_name);
+ expect(paramThree.querySelectorAll('a').length).toBe(0);
+ });
+
it('renders run stats correctly', () => {
if (isMulti) {
// no run stats in the multi-app version
diff --git a/test/unit/spec/narrative_core/kbaseNarrativeDownloadPanel-spec.js b/test/unit/spec/narrative_core/kbaseNarrativeDownloadPanel-spec.js
index cc97690f65..8c0f1f7bd6 100644
--- a/test/unit/spec/narrative_core/kbaseNarrativeDownloadPanel-spec.js
+++ b/test/unit/spec/narrative_core/kbaseNarrativeDownloadPanel-spec.js
@@ -8,6 +8,7 @@ define([
], ($, kbaseNarrativeDownloadPanel, Jupyter, Mocks, TestUtil, Config) => {
const JSON_EXPORT_APP = 'kb_staging_exporter/export_json_to_staging';
const STAGING_EXPORT_APP = 'kb_staging_exporter/export_to_staging';
+ const CSS_BASE = 'kb-download-panel';
describe('The kbaseNarrativeDownloadPanel widget', () => {
let $div = null;
@@ -124,7 +125,7 @@ define([
});
await initDownloadPanel(null, {});
- const $status = $div.find('.kb-download-status');
+ const $status = $div.find(`.${CSS_BASE}__status`);
expect($status.text()).toContain('Error: an error happened');
});
@@ -236,14 +237,14 @@ define([
await TestUtil.waitForElementState(
$div[0],
() => {
- const text = $div[0].querySelector('.kb-download-status').textContent || '';
+ const text = $div[0].querySelector(`.${CSS_BASE}__status`).textContent || '';
return text.endsWith(errorMsg);
},
() => {
exportBtns[0].click();
}
);
- expect($div[0].querySelector('.kb-download-status').textContent).toContain(errorMsg);
+ expect($div[0].querySelector(`.${CSS_BASE}__status`).textContent).toContain(errorMsg);
expect(widget.timer).toBeNull();
});
@@ -323,22 +324,22 @@ define([
await TestUtil.waitForElementState(
$div[0],
() => {
- const text = $div[0].querySelector('.kb-download-status').textContent || '';
+ const text = $div[0].querySelector(`.${CSS_BASE}__status`).textContent || '';
return text.endsWith('some log');
},
() => {
exportBtns[0].click();
}
);
- expect($div[0].querySelector('.kb-download-status').textContent).toContain('some log');
+ expect($div[0].querySelector(`.${CSS_BASE}__status`).textContent).toContain('some log');
expect(widget.timer).not.toBeNull();
await TestUtil.waitForElementState($div[0], () => {
- const text = $div[0].querySelector('.kb-download-status').textContent;
+ const text = $div[0].querySelector(`.${CSS_BASE}__status`).textContent;
return text === '';
});
- expect($div[0].querySelector('.kb-download-status').textContent).toBe('');
+ expect($div[0].querySelector(`.${CSS_BASE}__status`).textContent).toBe('');
expect(widget.timer).toBeNull();
});
@@ -383,14 +384,14 @@ define([
await TestUtil.waitForElementState(
$div[0],
() => {
- const text = $div[0].querySelector('.kb-download-status').textContent || '';
+ const text = $div[0].querySelector(`.${CSS_BASE}__status`).textContent || '';
return text.endsWith(errorMsg);
},
() => {
exportBtns[0].click();
}
);
- expect($div[0].querySelector('.kb-download-status').textContent).toContain(errorMsg);
+ expect($div[0].querySelector(`.${CSS_BASE}__status`).textContent).toContain(errorMsg);
expect(widget.timer).toBeNull();
});