Commit e167f1d9 authored by Enrique Alcantara's avatar Enrique Alcantara

Code review feedback

parent 446bdafc
...@@ -309,6 +309,18 @@ describe('WikiForm', () => { ...@@ -309,6 +309,18 @@ describe('WikiForm', () => {
); );
}); });
describe('when wikiSwitchBetweenContentEditorRawMarkdown feature flag is not enabled', () => {
beforeEach(() => {
createShallowWrapper(true, {
glFeatures: { wikiSwitchBetweenContentEditorRawMarkdown: false },
});
});
it('hides toggle editing mode button', () => {
expect(findToggleEditingModeButton().exists()).toBe(false);
});
});
describe('when wikiSwitchBetweenContentEditorRawMarkdown feature flag is enabled', () => { describe('when wikiSwitchBetweenContentEditorRawMarkdown feature flag is enabled', () => {
beforeEach(() => { beforeEach(() => {
createShallowWrapper(true, { createShallowWrapper(true, {
...@@ -330,10 +342,8 @@ describe('WikiForm', () => { ...@@ -330,10 +342,8 @@ describe('WikiForm', () => {
}); });
describe('when clicking the toggle editing mode button', () => { describe('when clicking the toggle editing mode button', () => {
beforeEach(async () => { beforeEach(() => {
findToggleEditingModeButton().vm.$emit('click'); findToggleEditingModeButton().vm.$emit('click');
await nextTick();
}); });
it('hides the classic editor', () => { it('hides the classic editor', () => {
...@@ -355,7 +365,7 @@ describe('WikiForm', () => { ...@@ -355,7 +365,7 @@ describe('WikiForm', () => {
setSerializedContent: jest.fn(), setSerializedContent: jest.fn(),
}; };
wrapper.setData({ useContentEditor: true }); findToggleEditingModeButton().vm.$emit('click');
}); });
it('hides switch to old editor button', () => { it('hides switch to old editor button', () => {
...@@ -369,15 +379,13 @@ describe('WikiForm', () => { ...@@ -369,15 +379,13 @@ describe('WikiForm', () => {
describe('when clicking the toggle editing mode button', () => { describe('when clicking the toggle editing mode button', () => {
const contentEditorFakeSerializedContent = 'fake content'; const contentEditorFakeSerializedContent = 'fake content';
beforeEach(async () => { beforeEach(() => {
mockContentEditor.getSerializedContent.mockReturnValueOnce( mockContentEditor.getSerializedContent.mockReturnValueOnce(
contentEditorFakeSerializedContent, contentEditorFakeSerializedContent,
); );
findContentEditor().vm.$emit('initialized', mockContentEditor); findContentEditor().vm.$emit('initialized', mockContentEditor);
findToggleEditingModeButton().vm.$emit('click'); findToggleEditingModeButton().vm.$emit('click');
await nextTick();
}); });
it('hides the content editor', () => { it('hides the content editor', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment