Refactor views to support dynamic updates.

This commit is contained in:
Dermot Duffy
2024-07-26 19:15:38 -07:00
parent 33dee47205
commit d5c4e56c45
80 changed files with 3714 additions and 4021 deletions
@@ -0,0 +1,26 @@
import { expect, it } from 'vitest';
import { createView } from '../../../test-utils';
import { RemoveContextViewModifier } from '../../../../src/card-controller/view/modifiers/remove-context';
it('should remove context property', () => {
const modifier = new RemoveContextViewModifier(['timeline']);
const view = createView({
view: 'live',
camera: 'camera',
displayMode: 'grid',
context: {
timeline: {
window: {
start: new Date(),
end: new Date(),
},
},
},
});
modifier.modify(view);
expect(view.context).toEqual({});
});