/* eslint-disable @typescript-eslint/no-unused-vars */
import { test } from "vitest";
test("ToKysely converts LixGenerated to Kysely Generated", () => {
    // Verify the conversion is correct by creating a type-compatible object
    const kyselyTable = {
        id: {},
        name: "test",
        count: {},
        metadata: { foo: "bar" },
        optional: null,
    };
    // These should work
    const id = {};
    const name = "test";
    const count = {};
    const metadata = { foo: "test" };
    const optional1 = "value";
    const optional2 = null;
    const optional3 = undefined;
});
test("LixDefault markers work with NewState", () => {
    // Define a mock schema with x-lix-default
    const MockEntitySchema = {
        "x-lix-key": "mock_entity",
        "x-lix-version": "1.0",
        "x-lix-primary-key": ["/id"],
        type: "object",
        properties: {
            id: { type: "string", "x-lix-default": "lix_nano_id()" },
            name: { type: "string" },
            count: { type: "number", "x-lix-default": "0" },
            optional_field: { type: "string", nullable: true },
        },
        required: ["id", "name", "count"],
        additionalProperties: false,
    };
    // Test that NewState makes generated fields optional
    const newMockEntity = {
        name: "test-name",
        // id should be optional because it's LixGenerated
        // count should be optional because it's LixGenerated
        // optional_field should be optional because it's nullable
    };
    // Test that NewState also accepts generated fields when provided
    const newMockEntityWithGenerated = {
        id: "custom-id",
        name: "test-name",
        count: 42,
        optional_field: "optional",
    };
    // Test that required non-generated fields are still required
    // @ts-expect-error - name is required
    const invalidNewMockEntity = {
        count: 42,
        // Missing required field 'name'
    };
    // Verify the types work as expected
    void newMockEntity;
    void newMockEntityWithGenerated;
    void invalidNewMockEntity;
});
//# sourceMappingURL=types.test.js.map