Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
js-jankisalvi committed Sep 20, 2024
1 parent 863f7b3 commit 7171b48
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('getFlappingSettingsRoute', () => {
expect(config).toMatchInlineSnapshot(`
Object {
"options": Object {
"access": "internal",
"tags": Array [
"access:read-flapping-settings",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ describe('archiveMaintenanceWindowRoute', () => {
);

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window/{id}/_archive');
expect(config.options?.tags?.[0]).toEqual('access:write-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:write-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ describe('bulkGetMaintenanceWindowRoute', () => {
);

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window/_bulk_get');
expect(config.options?.tags?.[0]).toEqual('access:read-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:read-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ describe('createMaintenanceWindowRoute', () => {
);

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window');
expect(config.options?.tags?.[0]).toEqual('access:write-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:write-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ describe('deleteMaintenanceWindowRoute', () => {
);

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window/{id}');
expect(config.options?.tags?.[0]).toEqual('access:write-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:write-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ describe('findMaintenanceWindowsRoute', () => {
const [context, req, res] = mockHandlerArguments({ maintenanceWindowClient }, { body: {} });

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window/_find');
expect(config.options?.tags?.[0]).toEqual('access:read-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:read-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ describe('finishMaintenanceWindowRoute', () => {
);

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window/{id}/_finish');
expect(config.options?.tags?.[0]).toEqual('access:write-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:write-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ describe('getMaintenanceWindowRoute', () => {
);

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window/{id}');
expect(config.options?.tags?.[0]).toEqual('access:read-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:read-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ describe('getActiveMaintenanceWindowsRoute', () => {
const [context, req, res] = mockHandlerArguments({ maintenanceWindowClient }, { body: {} });

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window/_active');
expect(config.options?.tags?.[0]).toEqual('access:read-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:read-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ describe('updateMaintenanceWindowRoute', () => {
);

expect(config.path).toEqual('/internal/alerting/rules/maintenance_window/{id}');
expect(config.options?.tags?.[0]).toEqual('access:write-maintenance-window');
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:write-maintenance-window",
],
}
`);

await handler(context, req, res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ describe('getScheduleFrequencyRoute', () => {

expect(config).toMatchInlineSnapshot(`
Object {
"options": Object {
"access": "internal",
},
"path": "/internal/alerting/rules/_schedule_frequency",
"validate": Object {},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('getQueryDelaySettingsRoute', () => {
expect(config).toMatchInlineSnapshot(`
Object {
"options": Object {
"access": "internal",
"tags": Array [
"access:read-query-delay-settings",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('updateQueryDelaySettingsRoute', () => {
expect(config.path).toMatchInlineSnapshot(`"/internal/alerting/rules/settings/_query_delay"`);
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:write-query-delay-settings",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe('updateFlappingSettingsRoute', () => {
expect(config.path).toMatchInlineSnapshot(`"/internal/alerting/rules/settings/_flapping"`);
expect(config.options).toMatchInlineSnapshot(`
Object {
"access": "internal",
"tags": Array [
"access:write-flapping-settings",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import type { caseApiV1 } from '../../../../common/types/api';
export const searchCasesRoute = createCasesRoute({
method: 'post',
path: `${CASES_INTERNAL_URL}/_search`,
routerOptions: {
access: 'internal',
},
handler: async ({ context, request, response }) => {
try {
const caseContext = await context.cases;
Expand Down

0 comments on commit 7171b48

Please sign in to comment.