Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com> Co-authored-by: Lawrence S <lboogie@Lawrences-Air.attlocal.net> Co-authored-by: Rajat Talesra <rajat@forem.com>
14 lines
486 B
JavaScript
14 lines
486 B
JavaScript
import { checkUserLoggedIn } from '@utilities/checkUserLoggedIn';
|
|
|
|
describe('CheckUserLoggedIn Utility', () => {
|
|
it('should return false if no body', () => {
|
|
const userLoggedIn = checkUserLoggedIn();
|
|
expect(userLoggedIn).toEqual(false);
|
|
});
|
|
|
|
it('should return true if user has the logged in attribute', () => {
|
|
document.body.setAttribute('data-user-status', 'logged-in');
|
|
const userLoggedIn = checkUserLoggedIn();
|
|
expect(userLoggedIn).toEqual(true);
|
|
});
|
|
});
|