mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
5dd0b1cf64
* Renames kolide_web_address to kolide_server_url * API client for new user setup * handle api response * Do not allow logged in users to register
37 lines
1006 B
JavaScript
37 lines
1006 B
JavaScript
import expect from 'expect';
|
|
|
|
import helpers from 'kolide/helpers';
|
|
|
|
describe('Kolide API - helpers', () => {
|
|
describe('#setupData', () => {
|
|
const formData = {
|
|
email: 'hi@gnar.dog',
|
|
name: 'Gnar Dog',
|
|
kolide_server_url: 'https://gnar.kolide.co',
|
|
org_logo_url: 'https://thegnar.co/assets/logo.png',
|
|
org_name: 'The Gnar Co.',
|
|
password: 'p@ssw0rd',
|
|
password_confirmation: 'p@ssw0rd',
|
|
username: 'gnardog',
|
|
};
|
|
|
|
it('formats the form data to send to the server', () => {
|
|
expect(helpers.setupData(formData)).toEqual({
|
|
kolide_server_url: 'https://gnar.kolide.co',
|
|
org_info: {
|
|
org_logo_url: 'https://thegnar.co/assets/logo.png',
|
|
org_name: 'The Gnar Co.',
|
|
},
|
|
admin: {
|
|
admin: true,
|
|
email: 'hi@gnar.dog',
|
|
name: 'Gnar Dog',
|
|
password: 'p@ssw0rd',
|
|
password_confirmation: 'p@ssw0rd',
|
|
username: 'gnardog',
|
|
},
|
|
});
|
|
});
|
|
});
|
|
});
|