Problem
With the come of team rights policies, there are a lot of almost indentical tests that should be run for some routes.
Solution
Parametrize tests that test team rights - make use of the test.each method to stuff similar test to one pack.
You can peek into the note.settings.test.ts to understand how it should be done.
Also, it would be nice to save this test.each as separate util for better convenience:
something like
test.roles = test.each([{ role: MemberRole.Read,
isPublic: false,
isAuthorized: true,
statusCode: 200 },
{ ... },
{ ... },
{ ... }
]);
and use it as
test.roles('Returns note with access rights by public id ....', ({ role, isPublic, isAuthorized, statusCode }) => {
})
Tasks
Problem
With the come of team rights policies, there are a lot of almost indentical tests that should be run for some routes.
Solution
Parametrize tests that test team rights - make use of the
test.eachmethod to stuff similar test to one pack.You can peek into the
note.settings.test.tsto understand how it should be done.Also, it would be nice to save this
test.eachas separate util for better convenience:something like
and use it as
Tasks
naming for tests in
test.each(fromjesttool). Right now we have same name for all tests in one scope, and it's not very convenient.