Initial support for grid for live and media viewer.

This commit is contained in:
Dermot Duffy
2023-08-08 22:26:25 -07:00
parent 69249b6c33
commit b663e0b731
59 changed files with 3308 additions and 429 deletions
+17 -1
View File
@@ -8,6 +8,7 @@ import {
dayToDate,
dispatchFrigateCardEvent,
errorToConsole,
filterTruthy,
formatDate,
formatDateAndTime,
getDurationString,
@@ -227,7 +228,13 @@ describe('isValidDate', () => {
});
describe('setOrRemoveAttribute', () => {
it('should set attribute', () => {
it('should set attribute without value', () => {
const element = document.createElement('div');
setOrRemoveAttribute(element, true, 'key');
expect(element.getAttribute('key')).toBe('');
});
it('should set attribute with value', () => {
const element = document.createElement('div');
setOrRemoveAttribute(element, true, 'key', 'value');
expect(element.getAttribute('key')).toBe('value');
@@ -240,3 +247,12 @@ describe('setOrRemoveAttribute', () => {
expect(element.getAttribute('key')).toBeFalsy();
});
});
describe('filterTruthy', () => {
it('should return true for true', () => {
expect(filterTruthy(true)).toBeTruthy();
});
it('should return false for false', () => {
expect(filterTruthy(false)).toBeFalsy();
});
});