Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('NumberInput', () => {
});

describe('key filtering', () => {
it.each(['-', '+', '.', 'e', 'E'])('prevents typing "%s"', (key) => {
it.each(['-', '+', ',', '.', 'e', 'E'])('prevents typing "%s"', (key) => {
renderInput({ value: 5 });
const input = screen.getByTestId('testNumberInput');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ describe('utils', () => {

describe('numeric input helpers', () => {
it('exposes invalid number keys for EuiFieldNumber guards', () => {
expect(INVALID_NUMBER_KEYS).toEqual(['-', '+', '.', 'e', 'E']);
expect(INVALID_NUMBER_KEYS).toEqual(['-', '+', ',', '.', 'e', 'E']);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { DataViewFieldMap } from '@kbn/data-views-plugin/common';

type TimeUnit = 's' | 'm' | 'h' | 'd';
export const POSITIVE_INTEGER_REGEX = /^[1-9][0-9]*$/;
export const INVALID_NUMBER_KEYS = ['-', '+', '.', 'e', 'E'];
export const INVALID_NUMBER_KEYS = ['-', '+', ',', '.', 'e', 'E'];

const TIME_UNITS: Record<TimeUnit, string> = {
s: i18n.translate('xpack.alertingV2.ruleForm.timeUnits.seconds', {
Expand Down
Loading