Skip to content

Commit

Permalink
removed uneeded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Jul 21, 2020
1 parent 5582f06 commit 12f6536
Showing 1 changed file with 2 additions and 48 deletions.
50 changes: 2 additions & 48 deletions x-pack/plugins/actions/server/authorization/audit_logger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe(`#constructor`, () => {
});

describe(`#actionsAuthorizationFailure`, () => {
test('logs auth failure with consumer scope', () => {
test('logs auth failure', () => {
const auditLogger = createMockAuditLogger();
const actionsAuditLogger = new ActionsAuthorizationAuditLogger(auditLogger);
const username = 'foo-user';
Expand All @@ -47,56 +47,10 @@ describe(`#actionsAuthorizationFailure`, () => {
]
`);
});

test('logs auth failure with producer scope', () => {
const auditLogger = createMockAuditLogger();
const actionsAuditLogger = new ActionsAuthorizationAuditLogger(auditLogger);
const username = 'foo-user';
const actionTypeId = 'action-type-id';

const operation = 'create';

actionsAuditLogger.actionsAuthorizationFailure(username, operation, actionTypeId);

expect(auditLogger.log.mock.calls[0]).toMatchInlineSnapshot(`
Array [
"actions_authorization_failure",
"foo-user Unauthorized to create a \\"action-type-id\\" action",
Object {
"actionTypeId": "action-type-id",
"operation": "create",
"username": "foo-user",
},
]
`);
});
});

describe(`#savedObjectsAuthorizationSuccess`, () => {
test('logs auth success with consumer scope', () => {
const auditLogger = createMockAuditLogger();
const actionsAuditLogger = new ActionsAuthorizationAuditLogger(auditLogger);
const username = 'foo-user';
const actionTypeId = 'action-type-id';

const operation = 'create';

actionsAuditLogger.actionsAuthorizationSuccess(username, operation, actionTypeId);

expect(auditLogger.log.mock.calls[0]).toMatchInlineSnapshot(`
Array [
"actions_authorization_success",
"foo-user Authorized to create a \\"action-type-id\\" action",
Object {
"actionTypeId": "action-type-id",
"operation": "create",
"username": "foo-user",
},
]
`);
});

test('logs auth success with producer scope', () => {
test('logs auth success', () => {
const auditLogger = createMockAuditLogger();
const actionsAuditLogger = new ActionsAuthorizationAuditLogger(auditLogger);
const username = 'foo-user';
Expand Down

0 comments on commit 12f6536

Please sign in to comment.