Skip to content
Snippets Groups Projects
Commit ddaac927 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-1377 adjust validation messages

parent 85aae82e
Branches
Tags
No related merge requests found
......@@ -3,7 +3,8 @@ import { createIssue } from '../../../test/error';
import { Issue } from '../tech.model';
import { getControlForIssue, getMessageForIssue, setValidationError } from './tech.validation.util';
describe('tech.validation.utils', () => {
describe('ValidationUtils', () => {
describe('setValidationError', () => {
const baseField1Control = new FormControl();
......@@ -19,6 +20,7 @@ describe('tech.validation.utils', () => {
});
describe('get control for issue', () => {
it('should return base field control', () => {
const issue: Issue = { ...createIssue(), field: 'baseField1' };
......@@ -45,7 +47,9 @@ describe('tech.validation.utils', () => {
})
describe('in base field', () => {
const issue: Issue = { ...createIssue(), field: 'baseField1' };
it('should set error in control', () => {
setValidationError(form, issue);
......@@ -72,6 +76,7 @@ describe('tech.validation.utils', () => {
});
describe('in subGroup Field', () => {
const issue: Issue = { ...createIssue(), field: 'subGroup.subGroupField1' };
it('should set error in control', () => {
......@@ -83,7 +88,9 @@ describe('tech.validation.utils', () => {
});
describe('get message for issue', () => {
const fieldLabel = 'Field Label';
it('should return message', () => {
const msg = getMessageForIssue(fieldLabel, { ...createIssue(), messageCode: 'validation_field_size' });
......
export const VALIDATION_MESSAGES: { [code: string]: string } = {
validation_field_empty: 'Bitte {field} ausfüllen',
validation_field_size: '{field} muss aus mindestens {min} Buchstaben bestehen',
validation_field_date_past: 'Datum für {field} muss in der Zukunft liegen',
validation_field_size: '{field} muss aus mindestens {min} Zeichen bestehen.',
validation_field_date_past: 'Das Datum für {field} muss in der Zukunft liegen',
validation_field_invalid: 'Bitte {field} korrekt ausfüllen',
fe_only_validation_bearbeiter_not_exist: 'Der Bearbeiter existiert nicht'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment