import { describe, expect, it } from 'vitest';
import { Id, toBase64 } from '../idv2.js';
import { unsetRelationFields } from './unset-relation-fields.js';
describe('unsetRelationFields', () => {
    it('should create an unset relation operation with valid parameters', () => {
        const id = Id('5cade575-7ecd-41ae-8348-1b22ffc2f94e');
        const fromVersion = true;
        const toSpace = true;
        const toVersion = true;
        const position = true;
        const verified = true;
        const result = unsetRelationFields({
            id,
            fromVersion,
            toSpace,
            toVersion,
            position,
            verified,
        });
        expect(result).toEqual({
            id,
            ops: [
                {
                    type: 'UNSET_RELATION_FIELDS',
                    unsetRelationFields: {
                        id: toBase64(id),
                        fromVersion,
                        toSpace,
                        toVersion,
                        position,
                        verified,
                    },
                },
            ],
        });
    });
    it('should handle optional parameters', () => {
        const id = Id('5cade575-7ecd-41ae-8348-1b22ffc2f94e');
        const toSpace = true;
        const position = true;
        const verified = true;
        const result = unsetRelationFields({
            id,
            toSpace,
            position,
            verified,
        });
        expect(result).toEqual({
            id,
            ops: [
                {
                    type: 'UNSET_RELATION_FIELDS',
                    unsetRelationFields: {
                        id: toBase64(id),
                        toSpace,
                        position,
                        verified,
                    },
                },
            ],
        });
    });
});
//# sourceMappingURL=unset-relation-fields.test.js.map