d4b1b2f661
* Add columns to companies: * account_owner_id * employees * address Add foreign key constraint companies_account_owner_id_fkey to auth.users.id * Add select permissions to: * account_owner_id * employees * address Add relationship between companies and auth.users. * Update Companies interface to include: * account_owner_id * employees * address Opportunity is expected to be replace by actual opportunity in a separate PR. * Add GetCompanies query * Add initial companies table * Update test to use mock apollo provider * Update to match changed company column names * Add company interface mapping tests * Test entire object * Add test for companies being rendered in table. * Add test for sorting reduce. * Fix prettier errors
13 lines
520 B
TypeScript
13 lines
520 B
TypeScript
import { CompaniesSelectedSortType, reduceSortsToOrderBy } from './select';
|
|
|
|
describe('reduceSortsToOrderBy', () => {
|
|
it('should return an array of objects with the id as key and the order as value', () => {
|
|
const sorts = [
|
|
{ key: 'name', label: 'name', order: 'asc' },
|
|
{ key: 'domain_name', label: 'domain_name', order: 'desc' },
|
|
] satisfies CompaniesSelectedSortType[];
|
|
const result = reduceSortsToOrderBy(sorts);
|
|
expect(result).toEqual([{ name: 'asc', domain_name: 'desc' }]);
|
|
});
|
|
});
|