docbrown/app/javascript/utilities/__tests__/checkUserLoggedIn.test.js
Lawrence 56e10f1306
Notifications Initializer Migration to Pack tag (#19124)
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>
2023-04-14 17:50:07 -04:00

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);
});
});