This commit is contained in:
Tom Moor
2018-06-01 00:01:06 -04:00
parent 9315e3f0f0
commit a7fc72e19f
4 changed files with 8 additions and 87 deletions

View File

@ -1,12 +1,12 @@
/* eslint-disable */ /* eslint-disable */
import UiStore from './UiStore'; import stores from '.';
// Actions // Actions
describe('UiStore', () => { describe('UiStore', () => {
let store; let store;
beforeEach(() => { beforeEach(() => {
store = new UiStore(); store = new stores.UiStore();
}); });
test('#add should add errors', () => { test('#add should add errors', () => {

View File

@ -1,82 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`#auth.login should login with email 1`] = `
Object {
"avatarUrl": "http://example.com/avatar.png",
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
"name": "User 1",
"username": "user1",
}
`;
exports[`#auth.login should login with username 1`] = `
Object {
"avatarUrl": "http://example.com/avatar.png",
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
"name": "User 1",
"username": "user1",
}
`;
exports[`#auth.login should require either username or email 1`] = `
Object {
"error": "validation_error",
"message": "username/email is required",
"ok": false,
"status": 400,
}
`;
exports[`#auth.login should require password 1`] = `
Object {
"error": "validation_error",
"message": "username/email is required",
"ok": false,
"status": 400,
}
`;
exports[`#auth.login should validate password 1`] = `
Object {
"error": "validation_error",
"message": "username/email is required",
"ok": false,
"status": 400,
}
`;
exports[`#auth.signup should require params 1`] = `
Object {
"error": "validation_error",
"message": "name is required",
"ok": false,
"status": 400,
}
`;
exports[`#auth.signup should require unique email 1`] = `
Object {
"error": "user_exists_with_email",
"message": "User already exists with this email",
"ok": false,
"status": 400,
}
`;
exports[`#auth.signup should require unique username 1`] = `
Object {
"error": "user_exists_with_username",
"message": "User already exists with this username",
"ok": false,
"status": 400,
}
`;
exports[`#auth.signup should require valid email 1`] = `
Object {
"error": "validation_error",
"message": "email is invalid",
"ok": false,
"status": 400,
}
`;

View File

@ -153,7 +153,10 @@ exports[`#user.update should update user profile information 1`] = `
Object { Object {
"data": Object { "data": Object {
"avatarUrl": "http://example.com/avatar.png", "avatarUrl": "http://example.com/avatar.png",
"email": "user1@example.com",
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61", "id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
"isAdmin": false,
"isSuspended": false,
"name": "New name", "name": "New name",
"username": "user1", "username": "user1",
}, },

View File

@ -1,7 +1,7 @@
/* eslint-disable flowtype/require-valid-file-annotation */ /* eslint-disable flowtype/require-valid-file-annotation */
import { flushdb, seed } from '../../test/support'; import { flushdb, seed } from '../test/support';
import { buildUser } from '../../test/factories'; import { buildUser } from '../test/factories';
import { ApiKey } from '../../models'; import { ApiKey } from '../models';
import randomstring from 'randomstring'; import randomstring from 'randomstring';
import auth from './authentication'; import auth from './authentication';