Skip to content

Commit

Permalink
Merge branch 'feature/shibui-1742' of bitbucket.org:unicon/shib-idp-u…
Browse files Browse the repository at this point in the history
…i into feature/shibui-1742
  • Loading branch information
chasegawa committed Aug 20, 2021
2 parents 92d8529 + e3dfc6e commit 5f2272e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/src/app/admin/hoc/RoleProvider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ import {useRole} from '../hooks';
jest.mock('../hooks');

describe('RoleProvider component', () => {
// let get;

beforeEach(() => {
test('should provide the role context', async () => {
let get = jest.fn().mockResolvedValue({ id: 'foo' });
useRole.mockImplementation(() => {
return {
get: jest.fn().mockResolvedValue({ id: 'foo' }),
get,
response: {
ok: false,
status: 200
}
};
});
})

test('should provide the role context', async () => {
act(() => {
render(<RoleProvider id={'foo'}>
{(role) => <div>{role?.id}</div>}
</RoleProvider>);
});

expect(useRole).toHaveBeenCalled();
expect(screen.getByText('foo')).toBeInTheDocument();
expect(get).toHaveBeenCalled();
});

})

0 comments on commit 5f2272e

Please sign in to comment.