update route group params

This commit is contained in:
Jake McDermott
2019-01-03 09:40:48 -05:00
parent 3e201d3ca0
commit dce50fe18b
6 changed files with 46 additions and 45 deletions

View File

@@ -17,7 +17,7 @@ describe('<App />', () => {
<App
routeGroups={[
{
title: 'Group One',
groupTitle: 'Group One',
groupId: 'group_one',
routes: [
{ title: 'Foo', path: '/foo' },
@@ -25,7 +25,7 @@ describe('<App />', () => {
],
},
{
title: 'Group Two',
groupTitle: 'Group Two',
groupId: 'group_two',
routes: [
{ title: 'Fiz', path: '/fiz' },
@@ -77,19 +77,13 @@ describe('<App />', () => {
expect(appWrapper.state().activeGroup).toBe(DEFAULT_ACTIVE_GROUP);
});
test('logout button click triggers expected callback', async (done) => {
test('onLogout makes expected call to api client', async (done) => {
const logout = jest.fn(() => Promise.resolve());
const api = { logout };
const appWrapper = mount(
<HashRouter>
<I18nProvider>
<App api={api} />
</I18nProvider>
</HashRouter>
);
const appWrapper = shallow(<App api={api} />);
appWrapper.find('button[id="button-logout"]').simulate('click');
appWrapper.instance().onLogout();
await asyncFlush();
expect(api.logout).toHaveBeenCalledTimes(1);
@@ -106,6 +100,6 @@ describe('<App />', () => {
</I18nProvider>
</HashRouter>
);
expect(api.get).toHaveBeenCalledTimes(1);
expect(getConfig).toHaveBeenCalledTimes(1);
});
});

View File

@@ -12,7 +12,7 @@ describe('NavExpandableGroup', () => {
<Nav aria-label="Test Navigation">
<NavExpandableGroup
groupId="test"
title="Test"
groupTitle="Test"
routes={[
{ path: '/foo', title: 'Foo' },
{ path: '/bar', title: 'Bar' },
@@ -45,7 +45,7 @@ describe('NavExpandableGroup', () => {
<Nav aria-label="Test Navigation">
<NavExpandableGroup
groupId="test"
title="Test"
groupTitle="Test"
routes={[
{ path: '/foo', title: 'Foo' },
{ path: '/bar', title: 'Bar' },