{"version":3,"file":"renderWithOdysseyProvider.cjs","names":["_vitestBrowserReact","require","_OdysseyProvider","_jsxRuntime","noTransitionsTheme","exports","transitions","create","duration","shortest","shorter","short","standard","complex","enteringScreen","leavingScreen","OdysseyWrapper","children","jsx","OdysseyProvider","themeOverride","renderWithOdysseyProvider","ui","options","render","wrapper"],"sources":["../../../src/test-utils/renderWithOdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type ThemeOptions } from \"@mui/material/styles\";\nimport { type ReactElement, type ReactNode } from \"react\";\nimport {\n  render,\n  type RenderOptions,\n  type RenderResult,\n} from \"vitest-browser-react\";\n\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\n\n// Kill transitions so axe never samples a mid-transition state.\n// `create` covers CSS transition strings; `duration` zeroes JS timeouts that MUI transition components (Fade, Slide, Collapse) use to decide when to unmount.\n//\n// Passed as `themeOverride` (plain `ThemeOptions`), not a resolved `createTheme` result: the provider deep-merges this into the Odyssey theme and re-runs `createTheme` so the override composes correctly. A resolved theme here would instead be merged as an already-built theme and clobber Odyssey's own values.\nexport const noTransitionsTheme = {\n  transitions: {\n    create: () => \"none\",\n    duration: {\n      shortest: 0,\n      shorter: 0,\n      short: 0,\n      standard: 0,\n      complex: 0,\n      enteringScreen: 0,\n      leavingScreen: 0,\n    },\n  },\n} satisfies ThemeOptions;\n\nconst OdysseyWrapper = ({ children }: { children: ReactNode }) => (\n  <OdysseyProvider themeOverride={noTransitionsTheme}>\n    {children}\n  </OdysseyProvider>\n);\n\n/**\n * Custom render that wraps the component in OdysseyProvider with MUI\n * transitions disabled. Both CSS transition strings (`transitions.create`) and\n * JS transition durations (`transitions.duration`) are zeroed so locator\n * queries and DOM removal are synchronous in tests. Use this in browser tests\n * instead of importing OdysseyProvider directly.\n *\n * Returns all standard vitest-browser-react render utilities */\nexport const renderWithOdysseyProvider = async (\n  ui: ReactElement,\n  options?: Omit<RenderOptions, \"wrapper\">,\n): Promise<RenderResult> => {\n  return render(ui, { wrapper: OdysseyWrapper, ...options });\n};\n"],"mappings":";;;;;;AAcA,IAAAA,mBAAA,GAAAC,OAAA;AAMA,IAAAC,gBAAA,GAAAD,OAAA;AAAwD,IAAAE,WAAA,GAAAF,OAAA;AApBxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAgBO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,WAAW,EAAE;IACXC,MAAM,EAAEA,CAAA,KAAM,MAAM;IACpBC,QAAQ,EAAE;MACRC,QAAQ,EAAE,CAAC;MACXC,OAAO,EAAE,CAAC;MACVC,KAAK,EAAE,CAAC;MACRC,QAAQ,EAAE,CAAC;MACXC,OAAO,EAAE,CAAC;MACVC,cAAc,EAAE,CAAC;MACjBC,aAAa,EAAE;IACjB;EACF;AACF,CAAwB;AAExB,MAAMC,cAAc,GAAGA,CAAC;EAAEC;AAAkC,CAAC,KAC3D,IAAAd,WAAA,CAAAe,GAAA,EAAChB,gBAAA,CAAAiB,eAAe;EAACC,aAAa,EAAEhB,kBAAmB;EAAAa,QAAA,EAChDA;AAAQ,CACM,CAClB;AAUM,MAAMI,yBAAyB,GAAG,MAAAA,CACvCC,EAAgB,EAChBC,OAAwC,KACd;EAC1B,OAAO,IAAAC,0BAAM,EAACF,EAAE,EAAE;IAAEG,OAAO,EAAET,cAAc;IAAE,GAAGO;EAAQ,CAAC,CAAC;AAC5D,CAAC;AAAClB,OAAA,CAAAgB,yBAAA,GAAAA,yBAAA","ignoreList":[]}