{"version":3,"file":"gravitee-ui-particles-angular-testing.mjs","sources":["../../../projects/ui-particles-angular/testing/harnesses/div.harness.ts","../../../projects/ui-particles-angular/testing/harnesses/span.harness.ts","../../../projects/ui-particles-angular/testing/harnesses/index.ts","../../../projects/ui-particles-angular/testing/public-api.ts","../../../projects/ui-particles-angular/testing/gravitee-ui-particles-angular-testing.ts"],"sourcesContent":["/*\n * Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *         http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseHarnessFilters, ComponentHarness, HarnessPredicate, TestElement } from '@angular/cdk/testing';\n\nexport type DivHarnessFilters = BaseHarnessFilters & {\n  /** Filters based on the text */\n  text?: string | RegExp;\n};\n\nexport class DivHarness extends ComponentHarness {\n  public static hostSelector = 'div';\n\n  /**\n   * Get Harness with the given filter.\n   *\n   * @param options Options for filtering which input instances are considered a match.\n   * @return a `HarnessPredicate` configured with the given options.\n   */\n  public static with(options: DivHarnessFilters = {}): HarnessPredicate<DivHarness> {\n    return new HarnessPredicate(DivHarness, options).addOption('text', options.text, (harness, text) =>\n      HarnessPredicate.stringMatches(harness.getText(), text),\n    );\n  }\n\n  public childLocatorFor = this.locatorFor;\n\n  public childLocatorForOptional = this.locatorForOptional;\n\n  public childLocatorForAll = this.locatorForAll;\n\n  public async getText(option?: { childSelector?: string }): Promise<string | null> {\n    let element: TestElement | null = await this.host();\n    if (option?.childSelector) {\n      element = await this.locatorForOptional(option.childSelector)();\n    }\n\n    return element ? element.text() : null;\n  }\n}\n","/*\n * Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *         http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { BaseHarnessFilters, ComponentHarness, HarnessPredicate, TestElement } from '@angular/cdk/testing';\n\nexport type SpanHarnessFilters = BaseHarnessFilters & {\n  /** Filters based on the text */\n  text?: string | RegExp;\n};\n\nexport class SpanHarness extends ComponentHarness {\n  public static hostSelector = 'span';\n\n  /**\n   * Get Harness with the given filter.\n   *\n   * @param options Options for filtering which input instances are considered a match.\n   * @return a `HarnessPredicate` configured with the given options.\n   */\n  public static with(options: SpanHarnessFilters = {}): HarnessPredicate<SpanHarness> {\n    return new HarnessPredicate(SpanHarness, options).addOption('text', options.text, (harness, text) =>\n      HarnessPredicate.stringMatches(harness.getText(), text),\n    );\n  }\n\n  public childLocatorFor = this.locatorFor;\n\n  public childLocatorForOptional = this.locatorForOptional;\n\n  public childLocatorForAll = this.locatorForAll;\n\n  public async getText(option?: { childSelector?: string }): Promise<string | null> {\n    let element: TestElement | null = await this.host();\n    if (option?.childSelector) {\n      element = await this.locatorForOptional(option.childSelector)();\n    }\n\n    return element ? element.text() : null;\n  }\n}\n","/*\n * Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *         http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './div.harness';\nexport * from './span.harness';\n","/*\n * Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *         http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from './harnesses';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;AAcG;AAQG,MAAO,UAAW,SAAQ,gBAAgB,CAAA;AAAhD,IAAA,WAAA,GAAA;;AAeS,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC,UAAU;AAEjC,QAAA,IAAA,CAAA,uBAAuB,GAAG,IAAI,CAAC,kBAAkB;AAEjD,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,CAAC,aAAa;IAUhD;aA5BgB,IAAA,CAAA,YAAY,GAAG,KAAH,CAAS;AAEnC;;;;;AAKG;AACI,IAAA,OAAO,IAAI,CAAC,OAAA,GAA6B,EAAE,EAAA;AAChD,QAAA,OAAO,IAAI,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KAC7F,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CACxD;IACH;IAQO,MAAM,OAAO,CAAC,MAAmC,EAAA;AACtD,QAAA,IAAI,OAAO,GAAuB,MAAM,IAAI,CAAC,IAAI,EAAE;AACnD,QAAA,IAAI,MAAM,EAAE,aAAa,EAAE;YACzB,OAAO,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QACjE;AAEA,QAAA,OAAO,OAAO,GAAG,O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