Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { url } from '@/components/utils/URLs';
import { exportConfigSetup } from '../utils';

describe('exportConfigSetup', () => {
test('generate correct configuration setup', () => {
Comment thread
Neeraj-gagat marked this conversation as resolved.
const props = {
encryption_secret: 'encryptionSecret',
uuid: 'clients-uuid',
} as any;

const result = exportConfigSetup(props);

expect(result).toContain(
'Configure Taskwarrior with these commands, run these commands one block at a time'
);

expect(result).toContain(
`task config sync.encryption_secret ${props.encryption_secret}`
);

expect(result).toContain(
`task config sync.server.origin ${url.containerOrigin}`
);

expect(result).toContain(`task config sync.server.client_id ${props.uuid}`);
});

test('returns string seprated with newline', () => {
Comment thread
Neeraj-gagat marked this conversation as resolved.
const props = {
encryption_secret: 'encryptionSecret',
uuid: 'clients-uuid',
} as any;

const result = exportConfigSetup(props);

const lines = result.split('\n');
expect(lines.length).toBeGreaterThan(1);
});
});
Loading