Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const Code = require('code');
const Lab = require('lab');
const React = require('react');
const ReactRouter = require('react-router-dom');
const ReactTestUtils = require('react-dom/test-utils');
const Results = require('../../../../../../client/pages/admin/statuses/search/results.jsx');
const lab = exports.lab = Lab.script();
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Admin Statuses Search Results', () => {
lab.test('it renders with and without a user information', (done) => {
const props = {
data: [{
_id: 'account-happy',
pivot: 'Account',
name: 'Happy'
}, {
_id: 'account-sad',
pivot: 'Account',
name: 'Sad'
}]
const ReactTestUtils = require('react-dom/test-utils');
const lab = exports.lab = Lab.script();
const stub = {
Actions: {}
};
const Form = Proxyquire('../../../../../../client/pages/admin/admins/details/user-form.jsx', {
'./actions': stub.Actions
});
const defaultProps = {
hasError: {},
help: {},
id: undefined
};
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Admin Admins User Form', () => {
lab.test('it renders', (done) => {
const FormEl = React.createElement(Form, defaultProps);
const RootEl = React.createElement(MemoryRouter, {}, FormEl);
const root = ReactTestUtils.renderIntoDocument(RootEl);
const form = ReactTestUtils.findRenderedComponentWithType(root, Form);
Code.expect(form).to.exist();
done();
});
const ReactTestUtils = require('react-dom/test-utils');
const lab = exports.lab = Lab.script();
const stub = {
Actions: {}
};
const Form = Proxyquire('../../../../../../client/pages/admin/accounts/details/user-form.jsx', {
'./actions': stub.Actions
});
const defaultProps = {
hasError: {},
help: {},
id: undefined
};
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Admin Accounts User Form', () => {
lab.test('it renders', (done) => {
const FormEl = React.createElement(Form, defaultProps);
const RootEl = React.createElement(MemoryRouter, {}, FormEl);
const root = ReactTestUtils.renderIntoDocument(RootEl);
const form = ReactTestUtils.findRenderedComponentWithType(root, Form);
Code.expect(form).to.exist();
done();
});
'use strict';
const Code = require('code');
const Lab = require('lab');
const React = require('react');
const ReactRouter = require('react-router-dom');
const ReactTestUtils = require('react-dom/test-utils');
const Results = require('../../../../../../client/pages/admin/admins/search/results.jsx');
const lab = exports.lab = Lab.script();
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Admin Admins Search Results', () => {
lab.test('it renders with and without a user information', (done) => {
const props = {
data: [{
_id: 'abcxyz',
name: {
first: 'Ren',
middle: '',
last: 'Hoek'
}
}, {
_id: 'xyzabc',
'use strict';
const Code = require('code');
const Lab = require('lab');
const NotFound = require('../../../../client/pages/main/not-found.jsx');
const React = require('react');
const ReactDOM = require('react-dom');
const ReactRouter = require('react-router-dom');
const ReactTestUtils = require('react-dom/test-utils');
const lab = exports.lab = Lab.script();
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Main Not Found Component', () => {
let RootEl;
lab.beforeEach((done) => {
const NotFoundEl = React.createElement(NotFound, {});
RootEl = React.createElement(MemoryRouter, {}, NotFoundEl);
done();
});
const ReactDOM = require('react-dom');
const ReactRouter = require('react-router-dom');
const ReactTestUtils = require('react-dom/test-utils');
const Store = require('../../../../../../client/pages/main/login/home/store');
const lab = exports.lab = Lab.script();
const stub = {
Actions: {
getUserCreds: function () {}
}
};
const Home = Proxyquire('../../../../../../client/pages/main/login/home/index.jsx', {
'../actions': stub.Actions
});
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Login Home Form', () => {
let RootEl;
lab.beforeEach((done) => {
const HomeEl = React.createElement(Home, {});
RootEl = React.createElement(MemoryRouter, {}, HomeEl);
done();
});
'use strict';
const Code = require('code');
const Lab = require('lab');
const NotFound = require('../../../../client/pages/admin/not-found.jsx');
const React = require('react');
const ReactDOM = require('react-dom');
const ReactRouter = require('react-router-dom');
const ReactTestUtils = require('react-dom/test-utils');
const lab = exports.lab = Lab.script();
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Admin Not Found Page', () => {
let RootEl;
lab.beforeEach((done) => {
const NotFoundEl = React.createElement(NotFound, {});
RootEl = React.createElement(MemoryRouter, {}, NotFoundEl);
done();
});
const Proxyquire = require('proxyquire');
const React = require('react');
const ReactDOM = require('react-dom');
const ReactRouter = require('react-router-dom');
const ReactTestUtils = require('react-dom/test-utils');
const Store = require('../../../../../../client/pages/main/login/reset/store');
const lab = exports.lab = Lab.script();
const stub = {
Actions: {}
};
const Reset = Proxyquire('../../../../../../client/pages/main/login/reset/index.jsx', {
'../actions': stub.Actions
});
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Login Reset Form', () => {
let RootEl;
lab.beforeEach((done) => {
const props = {
match: {
params: {
email: 'ren@stimpy',
key: 'abcxyz'
}
}
};
const Page = Proxyquire('../../../../../../client/pages/admin/users/details/index.jsx', {
'./actions': stub.Actions
});
const container = global.document.createElement('div');
const defaultProps = {
ref: function () {
if (defaultProps.ref.impl) {
defaultProps.ref.impl.apply(null, arguments);
}
},
match: {
params: {}
}
};
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Admin Users Details Page', () => {
let RootEl;
lab.beforeEach((done) => {
const PageEl = React.createElement(Page, defaultProps);
RootEl = React.createElement(MemoryRouter, {}, PageEl);
done();
});
'use strict';
const Code = require('code');
const Lab = require('lab');
const Navbar = require('../../../../client/pages/account/navbar.jsx');
const React = require('react');
const ReactDOM = require('react-dom');
const ReactRouter = require('react-router-dom');
const ReactTestUtils = require('react-dom/test-utils');
const lab = exports.lab = Lab.script();
const MemoryRouter = ReactRouter.MemoryRouter;
lab.experiment('Account Navbar', () => {
let RootEl;
lab.beforeEach((done) => {
const NavbarEl = React.createElement(Navbar, {
location: {}
});
RootEl = React.createElement(MemoryRouter, {}, NavbarEl);
done();
});