Skip to content

Commit

Permalink
fix brocken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guskovaue committed Dec 17, 2024
1 parent c2bb6e2 commit 54a7575
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('getStatusFilter', () => {
"type": "literal",
"value": "maintenance-window.attributes.events",
},
"gte",
"gt",
Object {
"isQuoted": true,
"type": "literal",
Expand Down Expand Up @@ -275,14 +275,14 @@ describe('getStatusFilter', () => {
});

it('return empty string if status does not exist', () => {
expect(getStatusFilter(['weird' as MaintenanceWindowStatus])).toMatchInlineSnapshot(`""`);
expect(getStatusFilter(['weird' as MaintenanceWindowStatus])).toBeUndefined();
});

it('return empty string if pass empty arguments', () => {
expect(getStatusFilter()).toMatchInlineSnapshot(`""`);
expect(getStatusFilter()).toBeUndefined();
});

it('return empty string if pass empty array', () => {
expect(getStatusFilter([])).toMatchInlineSnapshot(`""`);
expect(getStatusFilter([])).toBeUndefined();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo
.get(
`${getUrlPrefix(
space.id
)}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=running`
)}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=running`
)
.set('kbn-xsrf', 'foo')
.auth(user.username, user.password)
Expand All @@ -342,7 +342,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo
expect(response.body).to.eql({
error: 'Forbidden',
message:
'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=running] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]',
'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=running] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]',
statusCode: 403,
});
break;
Expand Down Expand Up @@ -417,7 +417,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo
.get(
`${getUrlPrefix(
space.id
)}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=upcoming`
)}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=upcoming`
)
.set('kbn-xsrf', 'foo')
.auth(user.username, user.password)
Expand All @@ -432,7 +432,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo
expect(response.body).to.eql({
error: 'Forbidden',
message:
'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=upcoming] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]',
'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=upcoming] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]',
statusCode: 403,
});
break;
Expand Down Expand Up @@ -507,7 +507,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo
.get(
`${getUrlPrefix(
space.id
)}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=running&statuses=finished`
)}/internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=running&status=finished`
)
.set('kbn-xsrf', 'foo')
.auth(user.username, user.password)
Expand All @@ -522,7 +522,7 @@ export default function findMaintenanceWindowTests({ getService }: FtrProviderCo
expect(response.body).to.eql({
error: 'Forbidden',
message:
'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&statuses=running&statuses=finished] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]',
'API [GET /internal/alerting/rules/maintenance_window/_find?page=1&per_page=10&status=running&status=finished] is unauthorized for user, this action is granted by the Kibana privileges [read-maintenance-window]',
statusCode: 403,
});
break;
Expand Down

0 comments on commit 54a7575

Please sign in to comment.