Skip to content

Commit

Permalink
fixing test and translation ids
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Jan 13, 2021
1 parent 4b2ec25 commit 880dba5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ export interface CardinalityValidatorError {
}

const jobExistsErrorMessage = i18n.translate(
'xpack.ml.newJob.wizard.validateJob.jobNameAlreadyExists',
'xpack.ml.newJob.wizard.validateJob.asyncJobNameAlreadyExists',
{
defaultMessage:
'Job ID already exists. A job ID cannot be the same as an existing job or group.',
}
);
const groupExistsErrorMessage = i18n.translate(
'xpack.ml.newJob.wizard.validateJob.jobNameAlreadyExists',
'xpack.ml.newJob.wizard.validateJob.asyncGroupNameAlreadyExists',
{
defaultMessage:
'Group ID already exists. A group ID cannot be the same as an existing group or job.',
Expand Down
15 changes: 12 additions & 3 deletions x-pack/test/api_integration/apis/ml/jobs/jobs_exist_spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default ({ getService }: FtrProviderContext) => {

const jobIdSpace1 = 'fq_single_space1';
const jobIdSpace2 = 'fq_single_space2';
const groupSpace1 = 'farequote';
const idSpace1 = 'space1';
const idSpace2 = 'space2';

Expand Down Expand Up @@ -57,17 +58,25 @@ export default ({ getService }: FtrProviderContext) => {

it('should find single job from same space', async () => {
const body = await runRequest(idSpace1, 200, [jobIdSpace1]);
expect(body).to.eql({ [jobIdSpace1]: true });
expect(body).to.eql({ [jobIdSpace1]: { exists: true, isGroup: false } });
});

it('should find single job from same space', async () => {
const body = await runRequest(idSpace1, 200, [groupSpace1]);
expect(body).to.eql({ [groupSpace1]: { exists: true, isGroup: true } });
});

it('should not find single job from different space', async () => {
const body = await runRequest(idSpace2, 200, [jobIdSpace1]);
expect(body).to.eql({ [jobIdSpace1]: false });
expect(body).to.eql({ [jobIdSpace1]: { exists: false, isGroup: false } });
});

it('should only find job from same space when called with a list of jobs', async () => {
const body = await runRequest(idSpace1, 200, [jobIdSpace1, jobIdSpace2]);
expect(body).to.eql({ [jobIdSpace1]: true, [jobIdSpace2]: false });
expect(body).to.eql({
[jobIdSpace1]: { exists: true, isGroup: false },
[jobIdSpace2]: { exists: false, isGroup: false },
});
});
});
};

0 comments on commit 880dba5

Please sign in to comment.