Skip to content

Commit

Permalink
fix(authorize): fixed unit tests 🤦
Browse files Browse the repository at this point in the history
  • Loading branch information
availity-bot committed May 9, 2019
1 parent 9c33610 commit 87cac9d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/authorize/tests/Authorize.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ beforeEach(() => {
avUserPermissionsApi.getPermissions.mockResolvedValue([
{
id: '1234',
organizationIds: ['1111']
organizationIds: ['1111'],
},
]);
});
Expand All @@ -31,7 +31,7 @@ describe('Authorize', () => {
await waitForElement(() => getByText('You have permission to see this'));
});

test('should render authorized content', async () => {
test('should render unauthorized content', async () => {
const { getByText } = render(
<Authorize
permissions="12345"
Expand Down Expand Up @@ -78,24 +78,20 @@ describe('Authorize', () => {
<Authorize
permissions="1234"
organizationId="1111"
negate
unauthorized="You do not have permission to see this"
>
You have permission to see this
</Authorize>
);

await waitForElement(() =>
getByText('You have permission to see this')
);
await waitForElement(() => getByText('You have permission to see this'));
});

test('should render unauthorized with incorrect organizationId', async () => {
const { getByText } = render(
<Authorize
permissions="1234"
organizationId="1112"
negate
unauthorized="You do not have permission to see this"
>
You have permission to see this
Expand Down

0 comments on commit 87cac9d

Please sign in to comment.