-
Notifications
You must be signed in to change notification settings - Fork 26
Added api/AuditLog.js and a test case to frontend.test.js #1864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
f32e7b2 to
55a53dc
Compare
b5b7c47 to
90afe4d
Compare
01c3cc7 to
311d4a6
Compare
test/api/AuditLog.js
Outdated
| describe('When token and access level is valid - status code 200', () => { | ||
| beforeEach(() => { | ||
| setTokenStatus(true, { accessLevel: MEMBERSHIP_STATE.OFFICER }); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need a beforeEach inside the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid it won't work without this block, since the beforeEach in the outer loop overrides all token setup. If this approach slows down the performance badly, we can consider restructuring the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Removed the beforeEach() block and moved all 200-status-code test cases into the same describe block with other test cases.
| details: {email: newUser.email }, | ||
| }); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are these loops for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loops create 63 records. The test checks that, when the query is empty, the route returns at most 50 records from the first page.
95b0963 to
92b35b9
Compare
92b35b9 to
eb66d5f
Compare
frontend-test:

===================================================================================
api-test:
