Пример #1
0
        it("does not override the last good selection with null value", () => {
            const lastGoodSelection = { index: 5, length: 93 };
            const init = {
                123: {
                    ...defaultInstance,
                    lastGoodSelection,
                },
            };

            const action = instanceActions.setSelection(123, null, quill);
            expect(instanceReducer(init, action)[123].lastGoodSelection).deep.equals(lastGoodSelection);
        });
Пример #2
0
 it("throws an error if the instance is already created", () => {
     const init = { 123: defaultInstance };
     const action = instanceActions.createInstance("123");
     expect(() => instanceReducer(init, action)).to.throw();
 });
Пример #3
0
 goodSelections.forEach(selection => {
     const action = instanceActions.setSelection(123, selection, quill);
     expect(instanceReducer(init, action)[123].lastGoodSelection).deep.equals(selection);
 });
Пример #4
0
 it("creates an instance with the default value", () => {
     const action = instanceActions.createInstance("123");
     expect(instanceReducer(undefined, action)).deep.equals({ 123: defaultInstance });
 });