This commit fixes an issue where the check state of categories was lost when toggling between card and tree views. This is solved by immediately emitting node state changes for all nodes. This ensures consistent view transitions without any loss of node state information. Furthermore, this commit includes added unit tests for the modified code sections.
20 lines
812 B
TypeScript
20 lines
812 B
TypeScript
import { NodeStateChangedEvent } from '@/presentation/components/Scripts/View/Tree/TreeView/Node/State/StateAccess';
|
|
import { TreeNodeStateDescriptor } from '@/presentation/components/Scripts/View/Tree/TreeView/Node/State/StateDescriptor';
|
|
import { TreeNodeStateDescriptorStub } from '@tests/unit/shared/Stubs/TreeNodeStateDescriptorStub';
|
|
|
|
export class NodeStateChangedEventStub implements NodeStateChangedEvent {
|
|
public oldState: TreeNodeStateDescriptor = new TreeNodeStateDescriptorStub();
|
|
|
|
public newState: TreeNodeStateDescriptor = new TreeNodeStateDescriptorStub();
|
|
|
|
public withNewState(newState: TreeNodeStateDescriptor): this {
|
|
this.newState = newState;
|
|
return this;
|
|
}
|
|
|
|
public withOldState(oldState: TreeNodeStateDescriptor): this {
|
|
this.oldState = oldState;
|
|
return this;
|
|
}
|
|
}
|