fleet/frontend/kolide/helpers.tests.js
Mike Stone 5dd0b1cf64 User registration submit (#490)
* 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
2016-11-21 15:22:14 -05:00

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',
},
});
});
});
});