/**
 * tests/fixtures/scene-preset.js
 *
 * ScenePreset fixtures — frozen. Includes edge case: empty matrix {}.
 */

export const SCENE_PRESET_FIXTURES = Object.freeze({
  valid: Object.freeze({
    _version: 1,
    name: "Combat Scene",
    matrix: Object.freeze({ "user-001": "active", "user-002": "hidden" }),
    createdAt: 1700000000000,
    updatedAt: 1700000000000,
  }),

  // Edge case: empty matrix (all participants in default state)
  emptyMatrix: Object.freeze({
    _version: 1,
    name: "Empty Preset",
    matrix: Object.freeze({}),
    createdAt: 1700000000000,
    updatedAt: 1700000000001,
  }),

  // Invalid: missing name
  missingName: Object.freeze({
    _version: 1,
    name: "",
    matrix: Object.freeze({}),
    createdAt: 1700000000000,
    updatedAt: 1700000000000,
  }),

  // Invalid: wrong version
  wrongVersion: Object.freeze({
    _version: 2,
    name: "Future Preset",
    matrix: Object.freeze({}),
    createdAt: 1700000000000,
    updatedAt: 1700000000000,
  }),
});

/**
 * Scene flag fixtures for auto-apply configuration.
 * Story 3.2: Scene Auto-Apply & ConfirmationBar
 */
export const SCENE_FLAG_AUTO_APPLY_FIXTURES = Object.freeze({
  // Flag with auto-apply enabled
  withAutoApplyEnabled: Object.freeze({
    _version: 1,
    presets: Object.freeze({
      "Combat": SCENE_PRESET_FIXTURES.valid,
    }),
    autoApply: Object.freeze({
      enabled: true,
      presetName: "Combat",
      preDelay: 1000,
    }),
  }),

  // Flag with auto-apply disabled
  withAutoApplyDisabled: Object.freeze({
    _version: 1,
    presets: Object.freeze({
      "Combat": SCENE_PRESET_FIXTURES.valid,
    }),
    autoApply: Object.freeze({
      enabled: false,
      presetName: "Combat",
      preDelay: 500,
    }),
  }),

  // Flag without autoApply field (migration case)
  withoutAutoApply: Object.freeze({
    _version: 1,
    presets: Object.freeze({
      "Combat": SCENE_PRESET_FIXTURES.valid,
    }),
  }),

  // Flag with auto-apply enabled but no preset selected
  withAutoApplyNoPreset: Object.freeze({
    _version: 1,
    presets: Object.freeze({}),
    autoApply: Object.freeze({
      enabled: true,
      presetName: null,
      preDelay: 0,
    }),
  }),

  // Flag with maximum pre-delay
  withMaxPreDelay: Object.freeze({
    _version: 1,
    presets: Object.freeze({
      "Combat": SCENE_PRESET_FIXTURES.valid,
    }),
    autoApply: Object.freeze({
      enabled: true,
      presetName: "Combat",
      preDelay: 5000,
    }),
  }),
});
