-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
2,244 additions
and
156 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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', | ||
}, | ||
]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
Oops, something went wrong.