1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/src/utils/formatAccessText.test.ts

12 lines
412 B
TypeScript

import { formatAccessText } from 'utils/formatAccessText';
test('formatAccessText with access', () => {
expect(formatAccessText(true)).toEqual(undefined);
expect(formatAccessText(true, 'Foo')).toEqual('Foo');
});
test('formatAccessText without access', () => {
expect(formatAccessText(false)).toEqual('Access denied');
expect(formatAccessText(false, 'Foo')).toEqual(`Foo (Access denied)`);
});