adjust tests

This commit is contained in:
Dominique Clarke 2023-05-08 09:42:47 -04:00
parent 8bea5cb8bf
commit 68da3ba942
2 changed files with 16 additions and 7 deletions

View file

@ -90,7 +90,7 @@ export default function ({ getService }: FtrProviderContext) {
it('does not add a monitor if there is an error in creating integration', async () => {
const newMonitor = { ...httpMonitorJson };
const invalidName = '[] - invalid name';
const invalidName = '!@#$%^&*()_++[\\-\\]- wow';
newMonitor.locations.push({
id: testFleetPolicyID,
@ -109,7 +109,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(apiResponse.body).eql({
statusCode: 500,
message:
'YAMLException: end of the stream or a document separator is expected at line 3, column 10:\n name: [] - invalid name\n ^',
'YAMLException: unknown escape sequence at line 3, column 34:\n name: "!@#$,%,^,&,*,(,),_,+,+,[,\\,\\,-,\\,\\,],-, ,w,o,w,"\n ^',
error: 'Internal Server Error',
});

View file

@ -50,11 +50,17 @@ export const getTestSyntheticsPolicy = (
type: { value: 'http', type: 'text' },
name: { value: `"${name}"`, type: 'text' },
schedule: { value: '"@every 5m"', type: 'text' },
urls: { value: 'https://nextjs-test-synthetics.vercel.app/api/users', type: 'text' },
'service.name': { value: '', type: 'text' },
urls: {
value: JSON.stringify('https://nextjs-test-synthetics.vercel.app/api/users'),
type: 'text',
},
'service.name': { value: null, type: 'text' },
timeout: { value: '3ms', type: 'text' },
max_redirects: { value: '3', type: 'integer' },
proxy_url: { value: proxyUrl ?? 'http://proxy.com', type: 'text' },
proxy_url: {
value: JSON.stringify(proxyUrl) ?? JSON.stringify('http://proxy.com'),
type: 'text',
},
proxy_headers: { value: null, type: 'yaml' },
tags: { value: '["tag1","tag2"]', type: 'yaml' },
username: { value: '"test-username"', type: 'text' },
@ -85,8 +91,11 @@ export const getTestSyntheticsPolicy = (
value: isTLSEnabled ? '["TLSv1.1","TLSv1.2"]' : null,
type: 'yaml',
},
location_name: { value: locationName ?? 'Test private location 0', type: 'text' },
id: { value: id, type: 'text' },
location_name: {
value: JSON.stringify(locationName) ?? JSON.stringify('Test private location 0'),
type: 'text',
},
id: { value: JSON.stringify(id), type: 'text' },
config_id: { value: id, type: 'text' },
run_once: { value: false, type: 'bool' },
origin: { value: 'ui', type: 'text' },