Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/datascience-ui/interactive-common/jupyterInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ export class JupyterInfo extends React.Component<IJupyterInfoProps> {
}

private renderTrustMessage() {
return (
<TrustMessage
shouldShowTrustMessage={this.props.shouldShowTrustMessage}
isNotebookTrusted={this.props.isNotebookTrusted}
launchNotebookTrustPrompt={this.props.launchNotebookTrustPrompt}
/>
);
if (this.props.shouldShowTrustMessage) {
return (
<TrustMessage
shouldShowTrustMessage={this.props.shouldShowTrustMessage}
isNotebookTrusted={this.props.isNotebookTrusted}
launchNotebookTrustPrompt={this.props.launchNotebookTrustPrompt}
/>
);
}
}

private selectKernel() {
Expand Down
6 changes: 6 additions & 0 deletions src/test/datascience/interactivePanel.functional.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CellState } from '../../client/datascience/types';
import { InteractiveCellComponent } from '../../datascience-ui/history-react/interactiveCell';
import { IInteractivePanelProps, InteractivePanel } from '../../datascience-ui/history-react/interactivePanel';
import { CursorPos, DebugState, ServerStatus } from '../../datascience-ui/interactive-common/mainState';
import { TrustMessage } from '../../datascience-ui/interactive-common/trustMessage';
import { noop } from '../core';
import { mountComponent } from './testHelpers';

Expand Down Expand Up @@ -133,4 +134,9 @@ suite('DataScience Interactive Panel', () => {

assert.equal(wrapper.find(InteractiveCellComponent).length, 0);
});
test('Trust message is not displayed', () => {
const wrapper = mountComponent('interactive', <InteractivePanel {...props}></InteractivePanel>);

assert.equal(wrapper.find(TrustMessage).length, 0);
});
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this test locally before and after the fix, and this will fail without the changes made in jupyterInfo.tsx (and it passes now), so it's testing what it claims to.

});