Skip to content

Commit

Permalink
#17 Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
blms committed Sep 1, 2020
2 parents 238dead + ad82d64 commit 4a931e6
Show file tree
Hide file tree
Showing 46 changed files with 2,244 additions and 156 deletions.
120 changes: 50 additions & 70 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"bootstrap": "^4.5.0",
"crypto-random-string": "^3.2.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.2.0",
"formik": "^2.1.4",
Expand All @@ -27,11 +28,12 @@
"moment": "^2.27.0",
"mongo-seeding": "^3.4.1",
"mongo-seeding-cli": "^3.4.1",
"mongodb": "^3.5.9",
"mongodb": "^3.6.0",
"next": "^9.5.1",
"next-auth": "^3.0.1",
"next-auth": "^3.1.0",
"next-connect": "^0.8.1",
"nodemailer": "^6.4.10",
"nookies": "^2.4.0",
"popper.js": "^1.16.1",
"react": "^16.13.1",
"react-bootstrap": "^1.0.1",
Expand Down Expand Up @@ -65,5 +67,8 @@
"jest-fetch-mock": "^3.0.3",
"react-test-renderer": "^16.12.0",
"test-listen": "^1.1.0"
},
"peerOptionalDependencies": {
"mongodb": "^3.6.0"
}
}
5 changes: 4 additions & 1 deletion src/__mocks__/next-auth/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ function useSession() {
user: {
name: 'Test User',
email: '[email protected]',
groups: [{
id: 'abcd1234', name: 'Test Group', ownerName: 'Test User', memberCount: 2, role: 'owner',
}],
},
expires: '2081-10-05T14:48:00.000',
expires: '2881-10-05T14:48:00.000',
},
];
}
Expand Down
40 changes: 40 additions & 0 deletions src/__tests__/groups/[id]/edit.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { render, wait } from '@testing-library/react';
import EditGroup from '../../../pages/groups/[id]/edit';

describe('Group Edit Page', () => {
const group = {
id: 'abcd1234',
name: 'Test Group',
members: [{
id: '1',
email: '[email protected]',
name: 'Test User',
role: 'owner',
}],
inviteUrl: '',
};

it('renders group card', async () => {
const { getByTestId } = render(<EditGroup group={group} />);
const cardBody = getByTestId('groupedit-card-body');
await wait(() => {
expect(cardBody).toBeInTheDocument();
});
});

it('renders members table', async () => {
const { getByTestId } = render(<EditGroup group={group} />);
const membersTable = getByTestId('groupedit-members-table');
await wait(() => {
expect(membersTable).toBeInTheDocument();
});
});

it('renders delete button', async () => {
const { getByTestId } = render(<EditGroup group={group} />);
const deleteButton = getByTestId('groupedit-delete-button');
await wait(() => {
expect(deleteButton).toBeInTheDocument();
});
});
});
39 changes: 39 additions & 0 deletions src/__tests__/groups/[id]/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { render, wait } from '@testing-library/react';
import ViewGroup from '../../../pages/groups/[id]/index';

describe('Group View Page', () => {
const group = {
id: 'abcd1234',
name: 'Test Group',
members: [{
id: '1',
email: '[email protected]',
name: 'Test User',
role: 'owner',
}],
};

it('renders group card', async () => {
const { getByTestId } = render(<ViewGroup group={group} />);
const cardBody = getByTestId('groupview-card-body');
await wait(() => {
expect(cardBody).toBeInTheDocument();
});
});

it('renders members table', async () => {
const { getByTestId } = render(<ViewGroup group={group} />);
const membersTable = getByTestId('groupview-members-table');
await wait(() => {
expect(membersTable).toBeInTheDocument();
});
});

it('renders button group', async () => {
const { getByTestId } = render(<ViewGroup group={group} />);
const buttonGroup = getByTestId('groupview-button-group');
await wait(() => {
expect(buttonGroup).toBeInTheDocument();
});
});
});
18 changes: 18 additions & 0 deletions src/__tests__/groups/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { render, wait } from '@testing-library/react';
import GroupList from '../../pages/groups/index';

test('renders group list card', async () => {
const { getByTestId } = render(<GroupList query={{ deletedGroupId: '' }} />);
const cardBody = getByTestId('grouplist-card-body');
await wait(() => {
expect(cardBody).toBeInTheDocument();
});
});

test('renders new group create button', async () => {
const { getByTestId } = render(<GroupList query={{ deletedGroupId: '' }} />);
const createButton = getByTestId('grouplist-create-button');
await wait(() => {
expect(createButton).toBeInTheDocument();
});
});
Loading

0 comments on commit 4a931e6

Please sign in to comment.