mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 00:08:44 -03:30
fix CodeEditor tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||||
import CodeEditor from './CodeEditor';
|
import CodeEditor from './CodeEditor';
|
||||||
|
|
||||||
describe('CodeEditor', () => {
|
describe('CodeEditor', () => {
|
||||||
@@ -9,7 +9,7 @@ describe('CodeEditor', () => {
|
|||||||
|
|
||||||
it('should pass value and mode through to ace editor', () => {
|
it('should pass value and mode through to ace editor', () => {
|
||||||
const onChange = jest.fn();
|
const onChange = jest.fn();
|
||||||
const wrapper = mount(
|
const wrapper = mountWithContexts(
|
||||||
<CodeEditor value={'---\nfoo: bar'} onChange={onChange} mode="yaml" />
|
<CodeEditor value={'---\nfoo: bar'} onChange={onChange} mode="yaml" />
|
||||||
);
|
);
|
||||||
const aceEditor = wrapper.find('AceEditor');
|
const aceEditor = wrapper.find('AceEditor');
|
||||||
@@ -20,7 +20,7 @@ describe('CodeEditor', () => {
|
|||||||
|
|
||||||
it('should trigger onChange prop', () => {
|
it('should trigger onChange prop', () => {
|
||||||
const onChange = jest.fn();
|
const onChange = jest.fn();
|
||||||
const wrapper = mount(
|
const wrapper = mountWithContexts(
|
||||||
<CodeEditor value="---" onChange={onChange} mode="yaml" />
|
<CodeEditor value="---" onChange={onChange} mode="yaml" />
|
||||||
);
|
);
|
||||||
const aceEditor = wrapper.find('AceEditor');
|
const aceEditor = wrapper.find('AceEditor');
|
||||||
@@ -30,7 +30,7 @@ describe('CodeEditor', () => {
|
|||||||
|
|
||||||
it('should render in read only mode', () => {
|
it('should render in read only mode', () => {
|
||||||
const onChange = jest.fn();
|
const onChange = jest.fn();
|
||||||
const wrapper = mount(
|
const wrapper = mountWithContexts(
|
||||||
<CodeEditor value="---" onChange={onChange} mode="yaml" readOnly />
|
<CodeEditor value="---" onChange={onChange} mode="yaml" readOnly />
|
||||||
);
|
);
|
||||||
const aceEditor = wrapper.find('AceEditor');
|
const aceEditor = wrapper.find('AceEditor');
|
||||||
|
|||||||
Reference in New Issue
Block a user