{"version":3,"file":"ngx-com-components-timepicker-testing.mjs","sources":["../../../projects/com/components/timepicker/testing/timepicker.harness.ts","../../../projects/com/components/timepicker/testing/index.ts","../../../projects/com/components/timepicker/testing/ngx-com-components-timepicker-testing.ts"],"sourcesContent":["import {\n  ComponentHarness,\n  HarnessPredicate,\n} from '@angular/cdk/testing';\nimport type { BaseHarnessFilters } from '@angular/cdk/testing';\n\n/** Harness filters for ComTimePickerHarness. */\nexport interface ComTimePickerHarnessFilters extends BaseHarnessFilters {\n  /** Filter by whether the time picker is disabled. */\n  disabled?: boolean;\n}\n\n/**\n * Harness for interacting with a ComTimePicker in tests.\n */\nexport class ComTimePickerHarness extends ComponentHarness {\n  static hostSelector = 'com-time-picker';\n\n  private readonly hourInput = this.locatorFor('input[aria-label=\"Hours\"]');\n  private readonly minuteInput = this.locatorFor('input[aria-label=\"Minutes\"]');\n  private readonly secondInput = this.locatorForOptional('input[aria-label=\"Seconds\"]');\n  private readonly periodToggle = this.locatorForOptional('button');\n\n  /**\n   * Gets a HarnessPredicate for matching time pickers.\n   * @param options Filter options.\n   */\n  static with(options: ComTimePickerHarnessFilters = {}): HarnessPredicate<ComTimePickerHarness> {\n    return new HarnessPredicate(ComTimePickerHarness, options)\n      .addOption('disabled', options.disabled, async (harness, disabled) => {\n        return (await harness.isDisabled()) === disabled;\n      });\n  }\n\n  /** Gets the current hours value from the hours spinbutton. */\n  async getHours(): Promise<number> {\n    const el = await this.hourInput();\n    const value = await el.getAttribute('aria-valuenow');\n    return Number(value);\n  }\n\n  /** Gets the current minutes value from the minutes spinbutton. */\n  async getMinutes(): Promise<number> {\n    const el = await this.minuteInput();\n    const value = await el.getAttribute('aria-valuenow');\n    return Number(value);\n  }\n\n  /** Gets the current seconds value, or null if seconds field is not shown. */\n  async getSeconds(): Promise<number | null> {\n    const el = await this.secondInput();\n    if (!el) return null;\n    const value = await el.getAttribute('aria-valuenow');\n    return value !== null ? Number(value) : null;\n  }\n\n  /** Gets the current period (AM/PM), or null if not in 12-hour format. */\n  async getPeriod(): Promise<'AM' | 'PM' | null> {\n    const el = await this.periodToggle();\n    if (!el) return null;\n    const text = (await el.text()).trim();\n    return text as 'AM' | 'PM';\n  }\n\n  /** Sets the hours value by clearing and typing into the hours input. */\n  async setHours(value: number): Promise<void> {\n    const el = await this.hourInput();\n    await el.clear();\n    await el.sendKeys(String(value));\n  }\n\n  /** Sets the minutes value by clearing and typing into the minutes input. */\n  async setMinutes(value: number): Promise<void> {\n    const el = await this.minuteInput();\n    await el.clear();\n    await el.sendKeys(String(value));\n  }\n\n  /** Sets the seconds value. Throws if the seconds field is not shown. */\n  async setSeconds(value: number): Promise<void> {\n    const el = await this.secondInput();\n    if (!el) {\n      throw Error('Cannot set seconds — the time picker does not have a seconds field. Set [showSeconds]=\"true\" first.');\n    }\n    await el.clear();\n    await el.sendKeys(String(value));\n  }\n\n  /** Toggles the AM/PM period. Throws if not in 12-hour format. */\n  async togglePeriod(): Promise<void> {\n    const el = await this.periodToggle();\n    if (!el) {\n      throw Error('Cannot toggle period — the time picker is not in 12-hour format. Set [use12HourFormat]=\"true\" first.');\n    }\n    await el.click();\n  }\n\n  /** Whether the time picker is disabled. */\n  async isDisabled(): Promise<boolean> {\n    const el = await this.hourInput();\n    return el.getProperty<boolean>('disabled');\n  }\n\n  /** Whether the seconds field is visible. */\n  async hasSeconds(): Promise<boolean> {\n    const el = await this.secondInput();\n    return el !== null;\n  }\n\n  /** Whether the time picker is in 12-hour format (has a period toggle). */\n  async has12HourFormat(): Promise<boolean> {\n    const el = await this.periodToggle();\n    return el !== null;\n  }\n\n  /** Focuses the hours input element. */\n  async focus(): Promise<void> {\n    const el = await this.hourInput();\n    return el.focus();\n  }\n\n  /** Blurs the hours input element. */\n  async blur(): Promise<void> {\n    const el = await this.hourInput();\n    return el.blur();\n  }\n\n  /** Whether the time picker host element is focused. */\n  async isFocused(): Promise<boolean> {\n    return (await this.host()).isFocused();\n  }\n}\n","// Testing utilities for the timepicker component\n\nexport { ComTimePickerHarness } from './timepicker.harness';\n\nexport type { ComTimePickerHarnessFilters } from './timepicker.harness';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAYA;;AAEG;AACG,MAAO,oBAAqB,SAAQ,gBAAgB,CAAA;AACxD,IAAA,OAAO,YAAY,GAAG,iBAAiB;AAEtB,IAAA,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;AACxD,IAAA,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC;AAC5D,IAAA,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,6BAA6B,CAAC;AACpE,IAAA,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC;AAEjE;;;AAGG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAuC,EAAE,EAAA;AACnD,QAAA,OAAO,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,OAAO;AACtD,aAAA,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,OAAO,EAAE,QAAQ,KAAI;YACnE,OAAO,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,MAAM,QAAQ;AAClD,QAAA,CAAC,CAAC;IACN;;AAGA,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE;QACjC,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC;AACpD,QAAA,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB;;AAGA,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE;QACnC,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC;AACpD,QAAA,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB;;AAGA,IAAA,MAAM,UAAU,GAAA;AACd,Q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