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
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/

import './setup_mocks';
import ace from 'brace';
import 'brace/mode/json';
const $ = require('jquery');
import $ from 'jquery';
import { initializeInput } from '../../src/input';


const tokenIterator = ace.acequire('ace/token_iterator');

describe('Input Tokenization', () => {
Expand Down
8 changes: 7 additions & 1 deletion src/core_plugins/console/public/tests/src/setup_mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ window.URL = {
createObjectURL: () => { return ''; }
};
jest.mock('../../src/storage');
document.queryCommandSupported = () => true;

document.queryCommandSupported = () => true;

import jQuery from 'jquery';
jest.spyOn(jQuery, 'ajax').mockImplementation(() => new Promise(() => {
// never resolve
}));
2 changes: 0 additions & 2 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,4 @@ export default {
'default',
'<rootDir>/src/dev/jest/junit_reporter.js',
],
// TODO: prevent tests from making web requests that rely on this setting, see https://github.com/facebook/jest/pull/6792
testURL: 'about:blank',
};
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ exports[`render 1`] = `
<EuiCopy
afterMessage="Copied"
anchorClassName="sharePanel__copyAnchor"
textToCopy="about:blank"
textToCopy="http://localhost/"
/>
</EuiForm>
`;
Expand Down Expand Up @@ -262,7 +262,7 @@ exports[`should enable saved object export option when objectId is provided 1`]
<EuiCopy
afterMessage="Copied"
anchorClassName="sharePanel__copyAnchor"
textToCopy="about:blank"
textToCopy="http://localhost/"
/>
</EuiForm>
`;
2 changes: 0 additions & 2 deletions x-pack/dev-tools/jest/create_jest_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,5 @@ export function createJestConfig({
rootDirectory: xPackKibanaDirectory,
}]
],
// TODO: prevent tests from making web requests that rely on this setting, see https://github.com/facebook/jest/pull/6792
testURL: 'about:blank',
};
}