Skip to content

Commit a1df80f

Browse files
committed
removed randomness from test
1 parent 633f20f commit a1df80f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

x-pack/plugins/actions/server/builtin_action_types/pagerduty.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,18 @@ describe('validateParams()', () => {
144144
`);
145145
});
146146

147-
test('should validate and throw error when timestamp is invalid', () => {
147+
test('should validate and throw error when timestamp has spaces', () => {
148148
const randoDate = new Date('1963-09-23T01:23:45Z').toISOString();
149-
const timestamp = `${repeat(' ', random(0, 10))}${randoDate}${repeat(' ', random(0, 10))}`;
149+
const timestamp = ` ${randoDate}`;
150+
expect(() => {
151+
validateParams(actionType, {
152+
timestamp,
153+
});
154+
}).toThrowError(`error validating action params: error parsing timestamp "${timestamp}"`);
155+
});
156+
157+
test('should validate and throw error when timestamp is invalid', () => {
158+
const timestamp = `1963-09-55 90:23:45`;
150159
expect(() => {
151160
validateParams(actionType, {
152161
timestamp,

0 commit comments

Comments
 (0)