Changeset View
Changeset View
Standalone View
Standalone View
native/redux/update-roles-and-permissions.test.js
// @flow | // @flow | ||||
import { | import { | ||||
threadStoreThreads, | threadStoreThreads, | ||||
threadStoreThreadsWithEmptyRolePermissions, | threadStoreThreadsWithEmptyRolePermissions, | ||||
threadStoreThreadsWithEmptyRolePermissionsAndMemberPermissions, | threadStoreThreadsWithEmptyRolePermissionsAndMemberPermissions, | ||||
threadStoreThreadsWithEmptyRoleAndMemberAndCurrentUserPermissions, | threadStoreThreadsWithEmptyRoleAndMemberAndCurrentUserPermissions, | ||||
} from './update-roles-and-permissions-test-data.js'; | } from './update-roles-and-permissions-test-data.js'; | ||||
import { updateRolesAndPermissions } from './update-roles-and-permissions.js'; | import { updateRolesAndPermissions } from './update-roles-and-permissions.js'; | ||||
describe('updateRolesAndPermissions()', () => { | describe.skip('updateRolesAndPermissions()', () => { | ||||
tomek: These tests are based on a state exported from @atul's redux - updating it is tricky and I… | |||||
tomekAuthorUnsubmitted Done Inline ActionsCreated https://linear.app/comm/issue/ENG-3901/rethink-roles-and-permissions-tests to update the tests tomek: Created https://linear.app/comm/issue/ENG-3901/rethink-roles-and-permissions-tests to update… | |||||
it('should leave threadStoreThreads from server unchanged', () => { | it('should leave threadStoreThreads from server unchanged', () => { | ||||
expect(updateRolesAndPermissions(threadStoreThreads)).toStrictEqual( | expect(updateRolesAndPermissions(threadStoreThreads)).toStrictEqual( | ||||
threadStoreThreads, | threadStoreThreads, | ||||
); | ); | ||||
}); | }); | ||||
it('should construct role permissions when missing from existing store', () => { | it('should construct role permissions when missing from existing store', () => { | ||||
expect( | expect( | ||||
Show All 20 Lines |
These tests are based on a state exported from @atul's redux - updating it is tricky and I haven't found a good way of doing that. Described it a bit in https://linear.app/comm/issue/ENG-3557/create-a-new-permission.