Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-03 09:07:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-03 09:07:23 +0300
commit3d6bfb323c80f30034921103df18cbc2a266fc19 (patch)
treea48b58a79685114848879011dd89be0b33124081 /spec/frontend
parentcd6db2c5b462479bf7d798acaf1f360def701c15 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/ci/pipeline_editor/components/editor/text_editor_spec.js29
-rw-r--r--spec/frontend/ide/components/repo_editor_spec.js27
2 files changed, 16 insertions, 40 deletions
diff --git a/spec/frontend/ci/pipeline_editor/components/editor/text_editor_spec.js b/spec/frontend/ci/pipeline_editor/components/editor/text_editor_spec.js
index 63e23c41263..ec987be8cb8 100644
--- a/spec/frontend/ci/pipeline_editor/components/editor/text_editor_spec.js
+++ b/spec/frontend/ci/pipeline_editor/components/editor/text_editor_spec.js
@@ -26,14 +26,13 @@ describe('Pipeline Editor | Text editor component', () => {
props: ['value', 'fileName', 'editorOptions', 'debounceValue'],
};
- const createComponent = (glFeatures = {}, mountFn = shallowMount) => {
+ const createComponent = (mountFn = shallowMount) => {
wrapper = mountFn(TextEditor, {
provide: {
projectPath: mockProjectPath,
projectNamespace: mockProjectNamespace,
ciConfigPath: mockCiConfigPath,
defaultBranch: mockDefaultBranch,
- glFeatures,
},
propsData: {
commitSha: mockCommitSha,
@@ -107,28 +106,14 @@ describe('Pipeline Editor | Text editor component', () => {
});
describe('CI schema', () => {
- describe('when `schema_linting` feature flag is on', () => {
- beforeEach(() => {
- createComponent({ schemaLinting: true });
- findEditor().vm.$emit(EDITOR_READY_EVENT, editorInstanceDetail);
- });
-
- it('configures editor with syntax highlight', () => {
- expect(mockUse).toHaveBeenCalledTimes(1);
- expect(mockRegisterCiSchema).toHaveBeenCalledTimes(1);
- });
+ beforeEach(() => {
+ createComponent();
+ findEditor().vm.$emit(EDITOR_READY_EVENT, editorInstanceDetail);
});
- describe('when `schema_linting` feature flag is off', () => {
- beforeEach(() => {
- createComponent();
- findEditor().vm.$emit(EDITOR_READY_EVENT, editorInstanceDetail);
- });
-
- it('does not call the register CI schema function', () => {
- expect(mockUse).not.toHaveBeenCalled();
- expect(mockRegisterCiSchema).not.toHaveBeenCalled();
- });
+ it('configures editor with syntax highlight', () => {
+ expect(mockUse).toHaveBeenCalledTimes(1);
+ expect(mockRegisterCiSchema).toHaveBeenCalledTimes(1);
});
});
});
diff --git a/spec/frontend/ide/components/repo_editor_spec.js b/spec/frontend/ide/components/repo_editor_spec.js
index 211fee31a9c..9092d73571b 100644
--- a/spec/frontend/ide/components/repo_editor_spec.js
+++ b/spec/frontend/ide/components/repo_editor_spec.js
@@ -122,7 +122,7 @@ describe('RepoEditor', () => {
vm.$once('editorSetup', resolve);
});
- const createComponent = async ({ state = {}, activeFile = dummyFile.text, flags = {} } = {}) => {
+ const createComponent = async ({ state = {}, activeFile = dummyFile.text } = {}) => {
const store = prepareStore(state, activeFile);
wrapper = shallowMount(RepoEditor, {
store,
@@ -132,9 +132,6 @@ describe('RepoEditor', () => {
mocks: {
ContentViewer,
},
- provide: {
- glFeatures: flags,
- },
});
await waitForPromises();
vm = wrapper.vm;
@@ -196,12 +193,8 @@ describe('RepoEditor', () => {
});
describe('schema registration for .gitlab-ci.yml', () => {
- const setup = async (activeFile, flagIsOn = true) => {
- await createComponent({
- flags: {
- schemaLinting: flagIsOn,
- },
- });
+ const setup = async (activeFile) => {
+ await createComponent();
vm.editor.registerCiSchema = jest.fn();
if (activeFile) {
wrapper.setProps({ file: activeFile });
@@ -210,15 +203,13 @@ describe('RepoEditor', () => {
await nextTick();
};
it.each`
- flagIsOn | activeFile | shouldUseExtension | desc
- ${false} | ${dummyFile.markdown} | ${false} | ${`file is not CI config; should NOT`}
- ${true} | ${dummyFile.markdown} | ${false} | ${`file is not CI config; should NOT`}
- ${false} | ${dummyFile.ciConfig} | ${false} | ${`file is CI config; should NOT`}
- ${true} | ${dummyFile.ciConfig} | ${true} | ${`file is CI config; should`}
+ activeFile | shouldUseExtension | desc
+ ${dummyFile.markdown} | ${false} | ${`file is not CI config; should NOT`}
+ ${dummyFile.ciConfig} | ${true} | ${`file is CI config; should`}
`(
- 'when the flag is "$flagIsOn", $desc use extension',
- async ({ flagIsOn, activeFile, shouldUseExtension }) => {
- await setup(activeFile, flagIsOn);
+ 'when the activeFile is "$activeFile", $desc use extension',
+ async ({ activeFile, shouldUseExtension }) => {
+ await setup(activeFile);
if (shouldUseExtension) {
expect(applyExtensionSpy).toHaveBeenCalledWith({