@aussieljk/forkbook 0.0.1-2 → 0.0.1-20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +35 -53
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +2 -2
- package/assets/browser/favicon-wrapper.svg +4 -4
- package/assets/browser/favicon.svg +1 -1
- package/assets/browser/inter-LICENSE.txt +92 -0
- package/assets/browser/inter-variable-italic.woff2 +0 -0
- package/assets/browser/inter-variable.woff2 +0 -0
- package/assets/browser/mirror-ball.png +0 -0
- package/assets/builder-vite/iframe.html +8 -24
- package/assets/create/rendererAssets/common/Configure.mdx +100 -100
- package/assets/create/rendererAssets/common/button.css +7 -7
- package/assets/create/rendererAssets/common/header.css +6 -6
- package/assets/create/rendererAssets/common/page.css +12 -12
- package/assets/create/templates/react-native/index.expo.js +4 -4
- package/assets/create/templates/react-native/index.js +5 -5
- package/assets/server/base-preview-body.html +32 -32
- package/assets/server/base-preview-head.html +86 -86
- package/assets/server/template.ejs +31 -26
- package/dist/_browser-chunks/{Color-PCLE2J36.js → Color-KALNKPOV.js} +8 -8
- package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
- package/dist/_browser-chunks/WithTooltip-66AWY4VQ.js +199 -0
- package/dist/_browser-chunks/{chunk-RBCHTR7C.js → chunk-2ELGJRFZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-PFRNG3UC.js → chunk-2WZWS7GJ.js} +5 -5
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-3QNZOMD7.js} +8 -3
- package/dist/_browser-chunks/{chunk-LV5PIKV4.js → chunk-3QPZOXB7.js} +6 -8
- package/dist/_browser-chunks/{chunk-ODVJ3XZJ.js → chunk-4BOJAE7P.js} +14 -10
- package/dist/_browser-chunks/{chunk-2MEPHP35.js → chunk-4KIQBRD2.js} +1 -1
- package/dist/_browser-chunks/chunk-4ZGQ4YQ2.js +20 -0
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/{chunk-W5M6NPS3.js → chunk-6SL45YM3.js} +15 -18
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-AN2LJG5I.js} +1 -1
- package/dist/_browser-chunks/{chunk-P6PK47TQ.js → chunk-BLCZ3C5M.js} +48 -83
- package/dist/_browser-chunks/{chunk-RSPAQWVJ.js → chunk-BNP234B4.js} +1 -1
- package/dist/_browser-chunks/{chunk-JYVGARBG.js → chunk-CX37N6FG.js} +770 -720
- package/dist/_browser-chunks/{chunk-JSBKXXXF.js → chunk-DHTLVXAL.js} +38 -45
- package/dist/_browser-chunks/{chunk-GNZY6LOW.js → chunk-DISGPOF4.js} +54 -51
- package/dist/_browser-chunks/chunk-DNJ3OSLB.js +6021 -0
- package/dist/_browser-chunks/{chunk-6SXYJQST.js → chunk-E6QKKKLO.js} +21 -6
- package/dist/_browser-chunks/{chunk-FJGWSWL5.js → chunk-EBSOKHFG.js} +10 -4
- package/dist/_browser-chunks/{chunk-CFAOWGL7.js → chunk-ECMVTOVD.js} +1 -1
- package/dist/_browser-chunks/{chunk-CFWWCCZV.js → chunk-ENHFQXYS.js} +9 -7
- package/dist/_browser-chunks/{chunk-YTIT5NA5.js → chunk-EW2M3URL.js} +91 -84
- package/dist/_browser-chunks/{chunk-MFMDGWP6.js → chunk-FCULT3AE.js} +3 -3
- package/dist/_browser-chunks/{chunk-46Z7NGAS.js → chunk-HX443LKV.js} +1 -1
- package/dist/_browser-chunks/chunk-HZFHNYRC.js +53 -0
- package/dist/_browser-chunks/chunk-IFADVEQE.js +669 -0
- package/dist/_browser-chunks/{chunk-OQWFVDIN.js → chunk-KQJ4T6JL.js} +31 -25
- package/dist/_browser-chunks/{chunk-RNTIV5CE.js → chunk-LYYXDWR2.js} +9 -9
- package/dist/_browser-chunks/{chunk-V5M7Q4HT.js → chunk-MJIDTL3X.js} +4 -14
- package/dist/_browser-chunks/{chunk-V2G23FV7.js → chunk-N5WQGLI7.js} +1 -1
- package/dist/_browser-chunks/{chunk-EIYAKDGP.js → chunk-NA4ITZTK.js} +127 -105
- package/dist/_browser-chunks/{chunk-RMYQ3QN3.js → chunk-NK5SGJNG.js} +22 -17
- package/dist/_browser-chunks/chunk-NPNIBOPF.js +18 -0
- package/dist/_browser-chunks/{chunk-YEKO6BHJ.js → chunk-ONTSNQON.js} +1 -1
- package/dist/_browser-chunks/chunk-OOETBSA7.js +502 -0
- package/dist/_browser-chunks/{chunk-KQ7CRO2B.js → chunk-OWWV6YG7.js} +12 -12
- package/dist/_browser-chunks/chunk-PFYL47RM.js +45 -0
- package/dist/_browser-chunks/{chunk-OD6IBQCC.js → chunk-PQRPDA4U.js} +5 -5
- package/dist/_browser-chunks/{chunk-2JDQ35OA.js → chunk-PU7D2WDP.js} +0 -11
- package/dist/_browser-chunks/chunk-PZQRXPVR.js +21 -0
- package/dist/_browser-chunks/{chunk-5WMXI5GW.js → chunk-QFO2B4X2.js} +31 -28
- package/dist/_browser-chunks/{chunk-2JT76G3E.js → chunk-SBOQ4QPY.js} +15 -15
- package/dist/_browser-chunks/{chunk-C3D4HEFY.js → chunk-TRXLBGLS.js} +344 -166
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/{chunk-5I7E4GMO.js → chunk-WY2LUGOH.js} +1 -1
- package/dist/_browser-chunks/chunk-XKTORVEQ.js +255 -0
- package/dist/_browser-chunks/chunk-XSVERCGB.js +91 -0
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-XTQCLWVH.js} +325 -1635
- package/dist/_browser-chunks/{chunk-MDOL7KML.js → chunk-YJO5BK52.js} +7 -3
- package/dist/_browser-chunks/{chunk-66OCZ54D.js → chunk-ZF37BMDS.js} +6 -2
- package/dist/_browser-chunks/{matchers-YLBYSYAF.js → matchers-2HVLNCVO.js} +4 -4
- package/dist/_browser-chunks/{react-dom-client-4OHE3QDV.js → react-dom-client-SLBUX3U3.js} +1 -1
- package/dist/_node-chunks/{attached-runtime-I2G4WLJI.js → attached-runtime-YD6HKC4B.js} +33 -31
- package/dist/_node-chunks/builder-manager-UNJGYVTD.js +1176 -0
- package/dist/_node-chunks/chunk-25A7444H.js +47 -0
- package/dist/_node-chunks/{chunk-U5W53R2J.js → chunk-2CNN3CRI.js} +506 -494
- package/dist/_node-chunks/{chunk-VLOXOXXE.js → chunk-2GA4VQCS.js} +9 -9
- package/dist/_node-chunks/{chunk-YZFWBA5L.js → chunk-2VJHCGAK.js} +368 -321
- package/dist/_node-chunks/{chunk-FK7KGTV7.js → chunk-33I6AQU7.js} +7 -7
- package/dist/_node-chunks/{chunk-6YKBRP72.js → chunk-3CQI3JH5.js} +6 -6
- package/dist/_node-chunks/{chunk-IK4FGZLR.js → chunk-3ZOSFS7G.js} +6 -6
- package/dist/_node-chunks/{chunk-DUR55DJJ.js → chunk-4BE3LRIQ.js} +86 -67
- package/dist/_node-chunks/{chunk-Q7QNUM5H.js → chunk-5LFJQCYN.js} +6 -6
- package/dist/_node-chunks/{chunk-3Y6AAY5H.js → chunk-65X3MXFT.js} +8 -8
- package/dist/_node-chunks/chunk-6FWJWEAG.js +52 -0
- package/dist/_node-chunks/{chunk-UVINFLGY.js → chunk-6NLQCV6A.js} +7 -7
- package/dist/_node-chunks/{chunk-KISMCCP5.js → chunk-6OQKMJJA.js} +474 -479
- package/dist/_node-chunks/{chunk-XLP2ZKXV.js → chunk-6RYD6ENB.js} +7 -7
- package/dist/_node-chunks/{chunk-V2DY426G.js → chunk-75TTPKEA.js} +283 -306
- package/dist/_node-chunks/{chunk-3W7F2B7P.js → chunk-7CWDZLIZ.js} +6 -6
- package/dist/_node-chunks/{chunk-FPZB5OI7.js → chunk-7M3TOE4F.js} +6 -6
- package/dist/_node-chunks/{chunk-DC7DKR5K.js → chunk-AGLGQNTY.js} +6 -6
- package/dist/_node-chunks/{chunk-NIBT7XDZ.js → chunk-AOYLA323.js} +9 -6
- package/dist/_node-chunks/{chunk-RRN2V55B.js → chunk-AP4HJ3I3.js} +7 -7
- package/dist/_node-chunks/chunk-AVHJZUTH.js +2613 -0
- package/dist/_node-chunks/{chunk-H32DYT6P.js → chunk-B2EEX2SZ.js} +6 -6
- package/dist/_node-chunks/chunk-CGVVOUBC.js +18 -0
- package/dist/_node-chunks/{chunk-B5J7Q7J4.js → chunk-CJDYU653.js} +6 -6
- package/dist/_node-chunks/{chunk-XHL2LVBM.js → chunk-CPDP5SQS.js} +14 -16
- package/dist/_node-chunks/{chunk-LO56I6E2.js → chunk-DAYTIH6Z.js} +10 -10
- package/dist/_node-chunks/{chunk-FW2HQUBQ.js → chunk-DO3CPQAZ.js} +6 -6
- package/dist/_node-chunks/chunk-DQEUNKLX.js +347 -0
- package/dist/_node-chunks/{chunk-BS2WMZMR.js → chunk-EFCBUWOB.js} +7 -7
- package/dist/_node-chunks/{chunk-OWNFOGTA.js → chunk-EG2WLN5V.js} +7 -7
- package/dist/_node-chunks/{chunk-LCK4ZQKG.js → chunk-EKYNX5NX.js} +9 -9
- package/dist/_node-chunks/{chunk-TNJIXE37.js → chunk-F762PHMI.js} +6 -6
- package/dist/_node-chunks/{chunk-ET7PWEO7.js → chunk-FC3V4KZO.js} +14 -13
- package/dist/_node-chunks/chunk-FXW52X4U.js +281 -0
- package/dist/_node-chunks/{chunk-TD5PLLQG.js → chunk-GEJBTN76.js} +62 -7
- package/dist/_node-chunks/chunk-GFEH7IBP.js +620 -0
- package/dist/_node-chunks/{chunk-TWI4GVH7.js → chunk-GWT4HQZU.js} +6 -6
- package/dist/_node-chunks/{chunk-4FEANXWU.js → chunk-HHM5X5RQ.js} +140 -118
- package/dist/_node-chunks/{chunk-MA24JW6C.js → chunk-IBLUURAJ.js} +25 -8
- package/dist/_node-chunks/{chunk-2BUPBPFB.js → chunk-IENHXJVB.js} +7 -7
- package/dist/_node-chunks/{chunk-EWOX7HPJ.js → chunk-IIGBIVK3.js} +6 -6
- package/dist/_node-chunks/{chunk-XGIUVY52.js → chunk-J6FGP2VM.js} +7 -7
- package/dist/_node-chunks/chunk-JOX7OETB.js +534 -0
- package/dist/_node-chunks/{chunk-RXNJDRGO.js → chunk-JR7ZCQ77.js} +21 -25
- package/dist/_node-chunks/{chunk-OISX4AGQ.js → chunk-JXZONVHW.js} +37 -31
- package/dist/_node-chunks/{chunk-34EO2PUT.js → chunk-KAALBGRE.js} +6 -6
- package/dist/_node-chunks/{chunk-SLWQNBGO.js → chunk-L52VGA36.js} +34 -949
- package/dist/_node-chunks/chunk-LAJIVWUF.js +497 -0
- package/dist/_node-chunks/{chunk-JGGFYIG5.js → chunk-LCNF6BLP.js} +7 -7
- package/dist/_node-chunks/chunk-LGHTKFSF.js +405 -0
- package/dist/_node-chunks/{chunk-WCULS5TP.js → chunk-LNGSV5UI.js} +7 -7
- package/dist/_node-chunks/{chunk-HMP2G23X.js → chunk-MC4BFUVH.js} +6 -6
- package/dist/_node-chunks/{chunk-SWO5CDYU.js → chunk-MWKSSYPG.js} +8 -8
- package/dist/_node-chunks/{chunk-2DSIDINN.js → chunk-N25CZ3RC.js} +650 -9
- package/dist/_node-chunks/{chunk-WZJF2OUH.js → chunk-N4LNGTYL.js} +7 -7
- package/dist/_node-chunks/{chunk-XI6B6P47.js → chunk-N5WU4BEY.js} +6 -6
- package/dist/_node-chunks/{chunk-TINO74G5.js → chunk-NRXCMSAI.js} +6 -6
- package/dist/_node-chunks/{chunk-E6YESGLX.js → chunk-NZWK62R5.js} +542 -1049
- package/dist/_node-chunks/{chunk-DHJFTB4K.js → chunk-OBPVOYJA.js} +7 -7
- package/dist/_node-chunks/{chunk-6KEHV53S.js → chunk-OMMQME7G.js} +33 -41
- package/dist/_node-chunks/chunk-PJRPETSU.js +62 -0
- package/dist/_node-chunks/{chunk-7GUDZVRQ.js → chunk-QDVIQG3B.js} +6 -6
- package/dist/_node-chunks/{chunk-OUW6R7C3.js → chunk-QEYWG5C7.js} +6 -6
- package/dist/_node-chunks/{chunk-GRBLDJCR.js → chunk-QQNRWEHL.js} +132 -149
- package/dist/_node-chunks/{chunk-EHUNOMDD.js → chunk-RAIWLNFA.js} +29849 -51588
- package/dist/_node-chunks/{chunk-JZOO7GGC.js → chunk-S7RGKBGT.js} +6 -6
- package/dist/_node-chunks/{chunk-GEFQN7K3.js → chunk-SFXFL4TP.js} +8 -8
- package/dist/_node-chunks/{chunk-JDXXX6LB.js → chunk-SPAHK37C.js} +6 -6
- package/dist/_node-chunks/chunk-SUQ4OM7Y.js +49 -0
- package/dist/_node-chunks/chunk-U54Q3F7E.js +20 -0
- package/dist/_node-chunks/{chunk-RWFIFGO5.js → chunk-UZH2V3WY.js} +8 -8
- package/dist/_node-chunks/{chunk-SVTBJ7Q3.js → chunk-VIMGLCNZ.js} +6 -6
- package/dist/_node-chunks/{chunk-BSKFCWQD.js → chunk-VNZF62KE.js} +7 -7
- package/dist/_node-chunks/{chunk-CCOTJ4FC.js → chunk-VPFU5CEP.js} +10 -10
- package/dist/_node-chunks/{chunk-RZMQ7S3L.js → chunk-VYCVBW5Q.js} +8 -8
- package/dist/_node-chunks/{chunk-ICPBH3E7.js → chunk-WDANLGYN.js} +7 -7
- package/dist/_node-chunks/{chunk-UMUBKI6E.js → chunk-WMZJ2WK4.js} +96 -177
- package/dist/_node-chunks/{chunk-LXBD4UL4.js → chunk-WTPHQ2NG.js} +8 -8
- package/dist/_node-chunks/chunk-WYCITRIE.js +11 -0
- package/dist/_node-chunks/chunk-WYRBOMQF.js +137 -0
- package/dist/_node-chunks/{chunk-ZWBCQ4MJ.js → chunk-WZBMPROH.js} +9 -17
- package/dist/_node-chunks/{chunk-CXRU72ET.js → chunk-X2GGQZIN.js} +6 -6
- package/dist/_node-chunks/chunk-X6OGIC2G.js +28 -0
- package/dist/_node-chunks/{chunk-42UWAGPW.js → chunk-XF7H5GZM.js} +52 -22
- package/dist/_node-chunks/{chunk-WNZ2UMFM.js → chunk-XUZB4FIX.js} +15 -9
- package/dist/_node-chunks/{chunk-3SDUYDXH.js → chunk-XVSUIOZA.js} +7 -7
- package/dist/_node-chunks/{chunk-TFEWM4E3.js → chunk-Z665R6AF.js} +75 -75
- package/dist/_node-chunks/{chunk-H4PPVMP5.js → chunk-ZEYZWDOS.js} +6 -6
- package/dist/_node-chunks/{chunk-UBOGWBEA.js → chunk-ZHRCL7PG.js} +10 -10
- package/dist/_node-chunks/chunk-ZLC4JSBV.js +25 -0
- package/dist/_node-chunks/{chunk-F3ZFKBHY.js → chunk-ZN6YOIB2.js} +8 -8
- package/dist/_node-chunks/{chunk-YCMRA6RX.js → chunk-ZX32M4O7.js} +7 -7
- package/dist/_node-chunks/{chunk-NDWKJ4CL.js → chunk-ZZ5XMIGW.js} +97 -111
- package/dist/_node-chunks/dist-HBFOS25E.js +16 -0
- package/dist/_node-chunks/dist-Q2XNFC24.js +27 -0
- package/dist/_node-chunks/{local-runtime-NTKIN2QT.js → local-runtime-4ETW6QTI.js} +19 -20
- package/dist/_node-chunks/{mdx-plugin-MWISDWDQ.js → mdx-plugin-OOYTYMVU.js} +2263 -130
- package/dist/_node-chunks/{monorepo-LIRFMQXE.js → monorepo-3AWUYNFD.js} +12 -12
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-ORY3BAP5.js} +12 -12
- package/dist/_node-chunks/optimized-tests-DOKSUJAM.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-EKHIUAU2.js → pattern-copy-play-AY4DE7ME.js} +12 -12
- package/dist/_node-chunks/postinstallAddon-L46G75CD.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-BUN3HUCO.js → rehype-external-links-FGVC633L.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-PLADX223.js → rehype-slug-2AZLMC5G.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-GBHW6KIQ.js → relaxed-limits-QI3YR6CU.js} +12 -12
- package/dist/_node-chunks/{run-NL66VTNR.js → run-QJJ4FOF3.js} +281 -19
- package/dist/_node-chunks/{run-KDTIZNSY.js → run-WFJZYNZN.js} +18 -18
- package/dist/_node-chunks/{setup-MGC7BQO6.js → setup-V5CRAJMV.js} +9 -9
- package/dist/_node-chunks/{vitest.config.4.template-JH2THZFG.js → vitest.config.4.template-LECBBF3L.js} +9 -9
- package/dist/actions/decorator.js +18 -22
- package/dist/actions/index.d.ts +4 -4
- package/dist/actions/index.js +3 -2
- package/dist/addon-a11y/index.d.ts +3 -3
- package/dist/addon-a11y/index.js +3 -2
- package/dist/addon-a11y/manager.js +41 -38
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.d.ts +8 -2
- package/dist/addon-a11y/preview.js +3 -2
- package/dist/addon-comments/manager.js +353 -0
- package/dist/addon-comments/preset.js +52 -0
- package/dist/addon-comments/preview.js +101 -0
- package/dist/addon-docs/blocks.d.ts +123 -85
- package/dist/addon-docs/blocks.js +159 -85
- package/dist/addon-docs/index.d.ts +21 -21
- package/dist/addon-docs/index.js +3 -3
- package/dist/addon-docs/manager.js +6 -6
- package/dist/addon-docs/preset.js +12 -12
- package/dist/addon-docs/preview.d.ts +3 -1
- package/dist/addon-docs/preview.js +1 -1
- package/dist/addon-links/index.d.ts +2 -1
- package/dist/addon-links/index.js +5 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +5 -2
- package/dist/addon-links/react/index.js +4 -1
- package/dist/addon-mcp/preset.js +176 -57
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +70 -70
- package/dist/addon-ondevice-actions/index.js +5 -1
- package/dist/addon-ondevice-actions/register.js +5 -1
- package/dist/addon-ondevice-controls/index.js +1 -1
- package/dist/addon-ondevice-controls/register.js +1 -1
- package/dist/addon-pseudo-states/index.d.ts +1 -1
- package/dist/addon-pseudo-states/index.js +1 -1
- package/dist/addon-pseudo-states/manager.js +2 -2
- package/dist/addon-pseudo-states/preview.d.ts +1 -1
- package/dist/addon-pseudo-states/preview.js +1 -1
- package/dist/addon-themes/index.d.ts +7 -6
- package/dist/addon-themes/index.js +2 -2
- package/dist/addon-themes/manager.js +4 -4
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-themes/preview.js +2 -2
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +32 -23
- package/dist/addon-vitest/node/coverage-reporter.js +11 -11
- package/dist/addon-vitest/node/vitest.js +35 -35
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +22 -22
- package/dist/addon-vitest/vitest-plugin/global-setup.js +22 -22
- package/dist/addon-vitest/vitest-plugin/index.js +78 -68
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +3 -3
- package/dist/addon-vitest/vitest-plugin/setup-file.js +1 -1
- package/dist/babel/index.d.ts +241 -995
- package/dist/babel/index.js +13 -19
- package/dist/backgrounds/index.d.ts +1 -1
- package/dist/bin/core.js +118 -95
- package/dist/bin/dispatcher.js +18 -16
- package/dist/bin/loader.js +17 -16
- package/dist/builder-next/index.d.ts +59 -0
- package/dist/builder-next/index.js +201 -0
- package/dist/builder-vite/index.d.ts +8 -3
- package/dist/builder-vite/index.js +80 -25
- package/dist/builder-vite/preset.js +13 -13
- package/dist/channels/index.d.ts +3 -2
- package/dist/channels/index.js +97 -24
- package/dist/{chunk-Dr3R0DXk.d.ts → chunk-B-NVyPqN.d.ts} +2 -2
- package/dist/{chunk-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
- package/dist/chunk-BcYKnZln.d.ts +10 -0
- package/dist/{chunk-DEVFdzxR.d.ts → chunk-BsO65uOb.d.ts} +4 -4
- package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
- package/dist/{chunk-Bpi2tz-6.d.ts → chunk-Bubi-WAs.d.ts} +20 -17
- package/dist/chunk-CDMZhRke.d.ts +30 -0
- package/dist/chunk-CFhJCPSB.d.ts +48 -0
- package/dist/{chunk-DtHByo32.d.ts → chunk-CFk6djyM.d.ts} +5 -5
- package/dist/{chunk-CMeX4WRe.d.ts → chunk-CT2iXaHz.d.ts} +1 -1
- package/dist/{chunk-pcFXCimE.d.ts → chunk-CmV7WZzR.d.ts} +124 -2
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-D2CQlXaR.d.ts} +13 -15
- package/dist/{chunk-BGkgZp-H.d.ts → chunk-D3uSIa6H.d.ts} +9 -1
- package/dist/{chunk-DzuY9DXg.d.ts → chunk-DDd8BhTY.d.ts} +2 -2
- package/dist/{chunk-Dw1z1Pki.d.ts → chunk-DNCU78oW.d.ts} +160 -323
- package/dist/chunk-DVIvUVkS.d.ts +195 -0
- package/dist/{chunk-gCX81nOr.d.ts → chunk-DgzPaTw9.d.ts} +3 -3
- package/dist/{chunk-Kt1tW-D1.d.ts → chunk-Dm-iHJ-s.d.ts} +3 -3
- package/dist/{chunk-C-bavsOH.d.ts → chunk-Dw_4ad2Y.d.ts} +6 -6
- package/dist/{chunk-CwQKNaYL.d.ts → chunk-OksNJcvJ.d.ts} +2 -2
- package/dist/chunk-Susgfkap.d.ts +20 -0
- package/dist/{chunk-C2p5r3Vt.d.ts → chunk-ge-rSPy0.d.ts} +818 -701
- package/dist/{chunk-BXLImeLy.d.ts → chunk-r-Vjut9o.d.ts} +52 -11
- package/dist/cli/index.d.ts +14 -867
- package/dist/cli/index.js +47 -4962
- package/dist/cli/skills/content/index.d.ts +2 -2
- package/dist/cli/skills/content/index.js +2 -2
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +3 -3
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.d.ts +20 -21
- package/dist/client-logger/index.js +5 -2
- package/dist/common/index.d.ts +27 -39
- package/dist/common/index.js +35 -42
- package/dist/components/index.d.ts +86 -272
- package/dist/components/index.js +2759 -8547
- package/dist/core-events/index.d.ts +6 -4
- package/dist/core-events/index.js +5 -1
- package/dist/core-server/index.d.ts +58 -17
- package/dist/core-server/index.js +1500 -382
- package/dist/core-server/presets/common-manager.js +836 -1334
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +100 -282
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/csf-utils.d.ts +1 -1
- package/dist/csf/index.d.ts +6 -6
- package/dist/csf/index.js +86 -154
- package/dist/csf-tools/index.d.ts +66 -54
- package/dist/csf-tools/index.js +18 -16
- package/dist/docs-tools/index.d.ts +332 -16
- package/dist/docs-tools/index.js +3 -3
- package/dist/highlight/index.d.ts +1 -1
- package/dist/instrumenter/index.d.ts +5 -5
- package/dist/instrumenter/index.js +31 -19
- package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-B4NRbNSS.js} +638 -1731
- package/dist/{preview/_chunks/runtime-CqHxptiK.js → manager/_manager-chunks/globals-runtime-BC43T1rL.js} +3413 -173
- package/dist/manager/_manager-chunks/{globals-runtime-sGpNlIJ1.js → globals-runtime-BDkYPr00.js} +715 -620
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-BnQ7i5wq.js} +232 -370
- package/dist/manager/_manager-chunks/{globals-runtime-Rp_zjGnh.js → globals-runtime-BnWjPJUH.js} +2 -2
- package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-Bv2PBsx6.js} +411 -379
- package/dist/manager/_manager-chunks/globals-runtime-BzuYs3dZ.js +1971 -0
- package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
- package/dist/manager/_manager-chunks/globals-runtime-CS41oTca.js +1808 -0
- package/dist/manager/_manager-chunks/globals-runtime-CoTrrHG3.js +1163 -0
- package/dist/manager/_manager-chunks/{globals-runtime-qKvCZHFY.js → globals-runtime-D6tkG2NO.js} +1033 -621
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-D9zzVzSP.js} +11 -11
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DCmvKMN5.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-DpNYC-qi.js → globals-runtime-DafcXCKU.js} +1013 -778
- package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
- package/dist/manager/_manager-chunks/globals-runtime-Me9Bl-sx.js +156 -0
- package/dist/manager/_manager-chunks/globals-runtime-nQMRiA0J.js +19 -0
- package/dist/manager/_manager-chunks/globals-runtime-oRjPg2jY.js +8935 -0
- package/dist/manager/_manager-chunks/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
- package/dist/manager/_manager-chunks/runtime-BhfRBP4G.js +294 -0
- package/dist/manager/_manager-chunks/runtime-BuPcYKCO.js +737 -0
- package/dist/manager/_manager-chunks/{runtime-eDVAYF7N.js → runtime-CGaGp83p.js} +57 -76
- package/dist/manager/_manager-chunks/{runtime-BhkT2CXl.js → runtime-CXROgt6G.js} +220 -406
- package/dist/manager/_manager-chunks/{runtime-i-PDAHLR.js → runtime-Cn5PJT3-.js} +741 -698
- package/dist/manager/_manager-chunks/{runtime-cp5pazY2.js → runtime-DJlTd1qE.js} +1717 -1536
- package/dist/manager/_manager-chunks/{runtime-D0UOWx0U.js → runtime-DTUm5K9J.js} +232 -158
- package/dist/manager/_manager-chunks/{runtime-D94Vq3oR.js → runtime-Dc6lf19c.js} +8 -534
- package/dist/manager/_manager-chunks/runtime-DmpQacrn.js +553 -0
- package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
- package/dist/manager/_manager-chunks/runtime-mjv_40eH.js +201 -0
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +12 -12
- package/dist/manager/globals.js +12 -12
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +537 -527
- package/dist/manager-errors.d.ts +1 -1
- package/dist/manager-errors.js +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mocking-utils/index.d.ts +7 -5
- package/dist/mocking-utils/index.js +34 -34
- package/dist/mocking-utils/mocker-runtime.js +2 -2
- package/dist/next/index.d.ts +231 -0
- package/dist/next/index.js +398 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +3 -1
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +4 -1
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +9 -1
- package/dist/nextjs-vite/export-mocks/router/index.js +13 -7
- package/dist/nextjs-vite/index.d.ts +4 -4
- package/dist/nextjs-vite/index.js +10 -5
- package/dist/nextjs-vite/node/index.d.ts +2 -2
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/node-stand-ins/index.d.ts +68 -0
- package/dist/nextjs-vite/node-stand-ins/index.js +145 -0
- package/dist/nextjs-vite/preset.js +117 -15
- package/dist/nextjs-vite/preview.d.ts +2 -1
- package/dist/nextjs-vite/preview.js +1 -1
- package/dist/nextjs-vite/vite-plugin/index.d.ts +2 -2
- package/dist/nextjs-vite/vite-plugin/index.js +9 -9
- package/dist/nextjs-vite-plugin/index.d.ts +2 -3
- package/dist/nextjs-vite-plugin/index.js +24 -49
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +10 -6
- package/dist/node-logger/index.d.ts +83 -90
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +15 -14
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/{manager/_manager-chunks/globals-runtime-8HkdnU2F.js → preview/_chunks/runtime-BYRCSYBN.js} +4440 -179
- package/dist/preview/_chunks/{runtime-CsV4HZPV.js → runtime-BiYuZt-X.js} +392 -173
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-Bvh_rfnQ.js} +29 -64
- package/dist/preview/_chunks/{runtime-iXdo8CR8.js → runtime-C88AzFBv.js} +772 -418
- package/dist/preview/_chunks/{runtime-DrTjJkPY.js → runtime-Cpzxe5eK.js} +447 -151
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-D2MPrqbU.js} +2 -2
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-DS0s7U3c.js} +482 -334
- package/dist/preview/_chunks/{runtime-CxZK_Ln3.js → runtime-MYVHRAoo.js} +3 -3
- package/dist/preview/globals.d.ts +10 -10
- package/dist/preview/globals.js +10 -10
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +3 -3
- package/dist/preview-api/index.js +12 -10
- package/dist/preview-errors.d.ts +1 -1
- package/dist/preview-errors.js +2 -2
- package/dist/react/docgen/docgen-worker.js +11 -12
- package/dist/react/entry-preview-argtypes.js +1 -1
- package/dist/react/entry-preview-docs.js +1 -1
- package/dist/react/entry-preview.js +2 -1
- package/dist/react/index.d.ts +9 -11
- package/dist/react/index.js +8 -6
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.d.ts +1 -1
- package/dist/react/preview.js +5 -4
- package/dist/react-native/bin/get-stories.js +12 -12
- package/dist/react-native/index.d.ts +48 -47
- package/dist/react-native/index.js +64 -249
- package/dist/react-native/metro/node.d.ts +3 -3
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/{withStorybook.d.ts → withForkbook.d.ts} +18 -18
- package/dist/react-native/metro/{withStorybook.js → withForkbook.js} +27 -26
- package/dist/react-native/preview.js +4 -1
- package/dist/react-native/scripts/generate.d.ts +1 -1
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-native/stub.js +1 -1
- package/dist/react-native-theming/index.d.ts +2 -58
- package/dist/react-native-theming/index.js +63 -2338
- package/dist/react-native-ui/index.d.ts +14 -14
- package/dist/react-native-ui/index.js +8 -15
- package/dist/react-native-ui-common/index.d.ts +32 -12
- package/dist/react-native-ui-common/index.js +26 -31
- package/dist/react-vite/index.d.ts +2 -2
- package/dist/react-vite/node/index.d.ts +3 -3
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.d.ts +3 -1
- package/dist/react-vite/preset.js +16 -9
- package/dist/router/index.d.ts +80 -3
- package/dist/router/index.js +66 -12
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +3 -3
- package/dist/shared/open-service/index.js +2 -2
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/shared/open-service/toolsets/docs/public.d.ts +28 -28
- package/dist/telemetry/index.d.ts +38 -274
- package/dist/telemetry/index.js +11 -68
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +765 -511
- package/dist/theming/create.d.ts +1 -1
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.d.ts +6 -6
- package/dist/theming/index.js +41 -16
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +5 -5
- package/dist/viewport/index.d.ts +1 -1
- package/package.json +69 -69
- package/skills/setup/SKILL.md +14 -0
- package/skills/stories/SKILL.md +21 -0
- package/skills/write-story/SKILL.md +14 -0
- package/template/nextjs-vite/cli/js/Button.jsx +2 -2
- package/template/nextjs-vite/cli/js/Button.stories.js +6 -6
- package/template/nextjs-vite/cli/js/Configure.mdx +100 -100
- package/template/nextjs-vite/cli/js/Header.jsx +1 -1
- package/template/nextjs-vite/cli/js/Header.stories.js +2 -2
- package/template/nextjs-vite/cli/js/Page.jsx +3 -3
- package/template/nextjs-vite/cli/js/Page.stories.js +2 -2
- package/template/nextjs-vite/cli/ts/Button.stories.ts +6 -6
- package/template/nextjs-vite/cli/ts/Button.tsx +2 -2
- package/template/nextjs-vite/cli/ts/Configure.mdx +84 -84
- package/template/nextjs-vite/cli/ts/Header.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Header.tsx +1 -1
- package/template/nextjs-vite/cli/ts/Page.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Page.tsx +3 -3
- package/template/react/cli/js/Button.jsx +2 -2
- package/template/react/cli/js/Button.stories.js +6 -6
- package/template/react/cli/js/Header.jsx +1 -1
- package/template/react/cli/js/Header.stories.js +2 -2
- package/template/react/cli/js/Page.jsx +3 -3
- package/template/react/cli/js/Page.stories.js +2 -2
- package/template/react/cli/ts/Button.stories.ts +6 -6
- package/template/react/cli/ts/Button.tsx +2 -2
- package/template/react/cli/ts/Header.stories.ts +2 -2
- package/template/react/cli/ts/Header.tsx +1 -1
- package/template/react/cli/ts/Page.stories.ts +2 -2
- package/template/react/cli/ts/Page.tsx +3 -3
- package/template/react-vite/cli/js/Button.jsx +2 -2
- package/template/react-vite/cli/js/Button.stories.js +6 -6
- package/template/react-vite/cli/js/Header.jsx +1 -1
- package/template/react-vite/cli/js/Header.stories.js +2 -2
- package/template/react-vite/cli/js/Page.jsx +3 -3
- package/template/react-vite/cli/js/Page.stories.js +2 -2
- package/template/react-vite/cli/ts/Button.stories.ts +6 -6
- package/template/react-vite/cli/ts/Button.tsx +2 -2
- package/template/react-vite/cli/ts/Header.stories.ts +2 -2
- package/template/react-vite/cli/ts/Header.tsx +1 -1
- package/template/react-vite/cli/ts/Page.stories.ts +2 -2
- package/template/react-vite/cli/ts/Page.tsx +3 -3
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +0 -1619
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +0 -108
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +0 -1661
- package/dist/_node-chunks/chunk-2RU7BKEW.js +0 -23
- package/dist/_node-chunks/chunk-3BKIBF5S.js +0 -3008
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +0 -662
- package/dist/_node-chunks/chunk-5DQFEZEA.js +0 -40
- package/dist/_node-chunks/chunk-6LMWA44H.js +0 -3837
- package/dist/_node-chunks/chunk-BXVYT7SB.js +0 -36
- package/dist/_node-chunks/chunk-CQKMLL5J.js +0 -33
- package/dist/_node-chunks/chunk-FY6UXW6G.js +0 -11
- package/dist/_node-chunks/chunk-IDEL2J23.js +0 -23
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +0 -29
- package/dist/_node-chunks/chunk-MK2KYAI6.js +0 -5414
- package/dist/_node-chunks/chunk-NPO45IMH.js +0 -33
- package/dist/_node-chunks/chunk-QEQLR22M.js +0 -1877
- package/dist/_node-chunks/chunk-SIEXZVCR.js +0 -51
- package/dist/_node-chunks/chunk-TEQGGSP7.js +0 -33
- package/dist/_node-chunks/chunk-TFCEV2XX.js +0 -155
- package/dist/_node-chunks/chunk-W4OMYLSP.js +0 -1297
- package/dist/_node-chunks/chunk-WAXVSN3O.js +0 -18
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +0 -4731
- package/dist/_node-chunks/dist-VTSTZKUB.js +0 -16
- package/dist/_node-chunks/globby-OEMHPBFY.js +0 -2884
- package/dist/_node-chunks/jiti-NFX6UU74.js +0 -3848
- package/dist/_node-chunks/lib-MDVARD7W.js +0 -366
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +0 -22
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +0 -20
- package/dist/_node-chunks/session-id-KIIVOQLR.js +0 -23
- package/dist/chunk-BTVrWliM.d.ts +0 -115
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/chunk-BxWufQms.d.ts +0 -142
- package/dist/chunk-DaVb55-_.d.ts +0 -124
- package/dist/core-server/presets/common-manager.css +0 -170
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +0 -3389
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +0 -9766
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +0 -5357
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +0 -10463
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +0 -452
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +0 -22
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +0 -998
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +0 -77
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +0 -63
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +0 -387
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { a as __toESM, n as __esmMin, r as __exportAll } from "./runtime-BdGkqNEt.js";
|
|
2
|
-
import {
|
|
3
|
-
import { d as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { a as __toESM, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./globals-runtime-BdGkqNEt.js";
|
|
2
|
+
import { f as require_redent } from "./globals-runtime-BnQ7i5wq.js";
|
|
3
|
+
import { _ as require_css_escape, d as init_dist$1, f as computeAccessibleName$1, g as require_ansi_regex, m as computeAccessibleDescription$1, v as require_lib } from "./globals-runtime-B4NRbNSS.js";
|
|
4
|
+
import { t as require_lz_string } from "./globals-runtime-oRjPg2jY.js";
|
|
5
|
+
import { d as require_picocolors_browser } from "./globals-runtime-BzuYs3dZ.js";
|
|
6
|
+
import { d as a, f as init_adobe_css_tools, l as _objectWithoutPropertiesLoose } from "./globals-runtime-DwFqpqya.js";
|
|
6
7
|
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/polyfills/array.from.mjs
|
|
7
8
|
function isCallable(fn) {
|
|
8
9
|
return typeof fn === "function" || toStr.call(fn) === "[object Function]";
|
|
@@ -579,7 +580,7 @@ function getControlOfLabel(label) {
|
|
|
579
580
|
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/labels
|
|
580
581
|
* @param element
|
|
581
582
|
*/
|
|
582
|
-
function getLabels(element) {
|
|
583
|
+
function getLabels$1(element) {
|
|
583
584
|
var labelsProperty = element.labels;
|
|
584
585
|
if (labelsProperty === null) return labelsProperty;
|
|
585
586
|
if (labelsProperty !== void 0) return arrayFrom(labelsProperty);
|
|
@@ -693,7 +694,7 @@ function computeTextAlternative(root) {
|
|
|
693
694
|
if (node.type === "submit") return "Submit";
|
|
694
695
|
if (node.type === "reset") return "Reset";
|
|
695
696
|
}
|
|
696
|
-
var labels = getLabels(node);
|
|
697
|
+
var labels = getLabels$1(node);
|
|
697
698
|
if (labels !== null && labels.length !== 0) {
|
|
698
699
|
consultedNodes.add(node);
|
|
699
700
|
return arrayFrom(labels).map(function(element) {
|
|
@@ -988,14 +989,14 @@ function getMessage(context, matcher, expectedLabel, expectedValue, receivedLabe
|
|
|
988
989
|
`${receivedLabel}:\n${context.utils.RECEIVED_COLOR((0, import_redent$1.default)(display(context, receivedValue), 2))}`
|
|
989
990
|
].join("\n");
|
|
990
991
|
}
|
|
991
|
-
function matches(textToMatch, matcher) {
|
|
992
|
+
function matches$1(textToMatch, matcher) {
|
|
992
993
|
if (matcher instanceof RegExp) return matcher.test(textToMatch);
|
|
993
994
|
else return textToMatch.includes(String(matcher));
|
|
994
995
|
}
|
|
995
996
|
function deprecate(name, replacementText) {
|
|
996
997
|
console.warn(`Warning: ${name} has been deprecated and will be removed in future updates.`, replacementText);
|
|
997
998
|
}
|
|
998
|
-
function normalize$
|
|
999
|
+
function normalize$2(text) {
|
|
999
1000
|
return text.replace(/\s+/g, " ").trim();
|
|
1000
1001
|
}
|
|
1001
1002
|
function getTag(element) {
|
|
@@ -1149,10 +1150,10 @@ function toContainHTML(container, htmlText) {
|
|
|
1149
1150
|
}
|
|
1150
1151
|
function toHaveTextContent(node, checkWith, options = { normalizeWhitespace: true }) {
|
|
1151
1152
|
checkNode(node, toHaveTextContent, this);
|
|
1152
|
-
const textContent = options.normalizeWhitespace ? normalize$
|
|
1153
|
+
const textContent = options.normalizeWhitespace ? normalize$2(node.textContent) : node.textContent.replace(/\u00a0/g, " ");
|
|
1153
1154
|
const checkingWithEmptyString = textContent !== "" && checkWith === "";
|
|
1154
1155
|
return {
|
|
1155
|
-
pass: !checkingWithEmptyString && matches(textContent, checkWith),
|
|
1156
|
+
pass: !checkingWithEmptyString && matches$1(textContent, checkWith),
|
|
1156
1157
|
message: () => {
|
|
1157
1158
|
const to = this.isNot ? "not to" : "to";
|
|
1158
1159
|
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveTextContent`, "element", ""), checkingWithEmptyString ? `Checking with empty string will always match, use .toBeEmptyDOMElement() instead` : `Expected element ${to} have text content`, checkWith, "Received", textContent);
|
|
@@ -1192,7 +1193,7 @@ function toHaveAccessibleErrorMessage(htmlElement, expectedAccessibleErrorMessag
|
|
|
1192
1193
|
return getMessage(this, this.utils.matcherHint(method, "element"), "Expected element to be marked as invalid with attribute", `${ariaInvalidName}="${String(true)}"`, "Received", htmlElement.hasAttribute("aria-invalid") ? `${ariaInvalidName}="${htmlElement.getAttribute(ariaInvalidName)}` : null);
|
|
1193
1194
|
}
|
|
1194
1195
|
};
|
|
1195
|
-
const error = normalize$
|
|
1196
|
+
const error = normalize$2(htmlElement.ownerDocument.getElementById(errormessageId)?.textContent ?? "");
|
|
1196
1197
|
return {
|
|
1197
1198
|
pass: expectedAccessibleErrorMessage === void 0 ? Boolean(error) : expectedAccessibleErrorMessage instanceof RegExp ? expectedAccessibleErrorMessage.test(error) : this.equals(error, expectedAccessibleErrorMessage),
|
|
1198
1199
|
message: () => {
|
|
@@ -1213,10 +1214,10 @@ function toHaveRole(htmlElement, expectedRole) {
|
|
|
1213
1214
|
}
|
|
1214
1215
|
function getExplicitOrImplicitRoles(htmlElement) {
|
|
1215
1216
|
if (htmlElement.hasAttribute("role")) return htmlElement.getAttribute("role").split(" ").filter(Boolean);
|
|
1216
|
-
return getImplicitAriaRoles(htmlElement);
|
|
1217
|
+
return getImplicitAriaRoles$1(htmlElement);
|
|
1217
1218
|
}
|
|
1218
|
-
function getImplicitAriaRoles(currentNode) {
|
|
1219
|
-
for (const { match, roles } of elementRoleList) if (match(currentNode)) return [...roles];
|
|
1219
|
+
function getImplicitAriaRoles$1(currentNode) {
|
|
1220
|
+
for (const { match, roles } of elementRoleList$1) if (match(currentNode)) return [...roles];
|
|
1220
1221
|
/* istanbul ignore next */
|
|
1221
1222
|
return [];
|
|
1222
1223
|
}
|
|
@@ -1234,7 +1235,7 @@ function getImplicitAriaRoles(currentNode) {
|
|
|
1234
1235
|
* available in all jest-dom environments? Why do other matchers in this package
|
|
1235
1236
|
* not use them like this?
|
|
1236
1237
|
*/
|
|
1237
|
-
function buildElementRoleList(elementRolesMap) {
|
|
1238
|
+
function buildElementRoleList$1(elementRolesMap) {
|
|
1238
1239
|
function makeElementSelector({ name, attributes }) {
|
|
1239
1240
|
return `${name}${attributes.map(({ name: attributeName, value, constraints = [] }) => {
|
|
1240
1241
|
if (constraints.indexOf("undefined") !== -1) return `:not([${attributeName}])`;
|
|
@@ -1499,12 +1500,12 @@ function isFirstLegendChildOfFieldset(element, parent) {
|
|
|
1499
1500
|
function isElementDisabledByParent(element, parent) {
|
|
1500
1501
|
return isElementDisabled(parent) && !isFirstLegendChildOfFieldset(element, parent);
|
|
1501
1502
|
}
|
|
1502
|
-
function isCustomElement(tag) {
|
|
1503
|
+
function isCustomElement$1(tag) {
|
|
1503
1504
|
return tag.includes("-");
|
|
1504
1505
|
}
|
|
1505
1506
|
function canElementBeDisabled(element) {
|
|
1506
1507
|
const tag = getTag(element);
|
|
1507
|
-
return FORM_TAGS$2.includes(tag) || isCustomElement(tag);
|
|
1508
|
+
return FORM_TAGS$2.includes(tag) || isCustomElement$1(tag);
|
|
1508
1509
|
}
|
|
1509
1510
|
function isElementDisabled(element) {
|
|
1510
1511
|
return canElementBeDisabled(element) && element.hasAttribute("disabled");
|
|
@@ -1694,10 +1695,10 @@ function supportedRolesSentence() {
|
|
|
1694
1695
|
return toSentence(supportedRoles().map((role) => `role="${role}"`), { lastWordConnector: " or " });
|
|
1695
1696
|
}
|
|
1696
1697
|
function supportedRoles() {
|
|
1697
|
-
return import_lib$
|
|
1698
|
+
return import_lib$2.roles.keys().filter(roleSupportsChecked);
|
|
1698
1699
|
}
|
|
1699
1700
|
function roleSupportsChecked(role) {
|
|
1700
|
-
return import_lib$
|
|
1701
|
+
return import_lib$2.roles.get(role)?.props["aria-checked"] !== void 0;
|
|
1701
1702
|
}
|
|
1702
1703
|
function toBePartiallyChecked(element) {
|
|
1703
1704
|
checkHtmlElement(element, toBePartiallyChecked, this);
|
|
@@ -1737,7 +1738,7 @@ function toHaveDescription(htmlElement, checkWith) {
|
|
|
1737
1738
|
let description = "";
|
|
1738
1739
|
if (descriptionIDs.length > 0) {
|
|
1739
1740
|
const document = htmlElement.ownerDocument;
|
|
1740
|
-
description = normalize$
|
|
1741
|
+
description = normalize$2(descriptionIDs.map((descriptionID) => document.getElementById(descriptionID)).filter(Boolean).map((el) => el.textContent).join(" "));
|
|
1741
1742
|
}
|
|
1742
1743
|
return {
|
|
1743
1744
|
pass: expectsDescription ? checkWith instanceof RegExp ? checkWith.test(description) : this.equals(description, checkWith) : Boolean(description),
|
|
@@ -1764,7 +1765,7 @@ function toHaveErrorMessage(htmlElement, checkWith) {
|
|
|
1764
1765
|
let errormessage = "";
|
|
1765
1766
|
if (errormessageIDs.length > 0) {
|
|
1766
1767
|
const document = htmlElement.ownerDocument;
|
|
1767
|
-
errormessage = normalize$
|
|
1768
|
+
errormessage = normalize$2(errormessageIDs.map((errormessageID) => document.getElementById(errormessageID)).filter(Boolean).map((el) => el.textContent).join(" "));
|
|
1768
1769
|
}
|
|
1769
1770
|
return {
|
|
1770
1771
|
pass: expectsErrorMessage ? checkWith instanceof RegExp ? checkWith.test(errormessage) : this.equals(errormessage, checkWith) : Boolean(errormessage),
|
|
@@ -1892,13 +1893,13 @@ function toAppearBefore(element, secondElement) {
|
|
|
1892
1893
|
function toAppearAfter(element, secondElement) {
|
|
1893
1894
|
return checkToAppear("toAppearAfter", DOCUMENT_POSITION_PRECEDING).apply(this, [element, secondElement]);
|
|
1894
1895
|
}
|
|
1895
|
-
var import_redent$1, import_lib$
|
|
1896
|
+
var import_redent$1, import_lib$2, import_picocolors_browser, import_css_escape$1, GenericTypeError, HtmlElementTypeError, NodeTypeError, InvalidCSSError, rolesSupportingValues, ariaInvalidName, validStates, elementRoleList$1, FORM_TAGS$2, FORM_TAGS$1, ARIA_FORM_TAGS, UNSUPPORTED_INPUT_TYPES, SUPPORTED_ARIA_ROLES, FORM_TAGS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_PRECEDING, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITIONS_STRINGS;
|
|
1896
1897
|
function init_matchers_35e4d3bd() {
|
|
1897
1898
|
return (init_matchers_35e4d3bd = __esmMin((() => {
|
|
1898
1899
|
import_redent$1 = /* @__PURE__ */ __toESM(require_redent(), 1);
|
|
1899
1900
|
init_adobe_css_tools();
|
|
1900
1901
|
init_dist();
|
|
1901
|
-
import_lib$
|
|
1902
|
+
import_lib$2 = require_lib();
|
|
1902
1903
|
import_picocolors_browser = /* @__PURE__ */ __toESM(require_picocolors_browser(), 1);
|
|
1903
1904
|
import_css_escape$1 = /* @__PURE__ */ __toESM(require_css_escape(), 1);
|
|
1904
1905
|
GenericTypeError = class extends Error {
|
|
@@ -1923,132 +1924,3359 @@ function init_matchers_35e4d3bd() {
|
|
|
1923
1924
|
super("be an HTMLElement or an SVGElement", ...args);
|
|
1924
1925
|
}
|
|
1925
1926
|
};
|
|
1926
|
-
NodeTypeError = class extends GenericTypeError {
|
|
1927
|
-
constructor(...args) {
|
|
1928
|
-
super("be a Node", ...args);
|
|
1927
|
+
NodeTypeError = class extends GenericTypeError {
|
|
1928
|
+
constructor(...args) {
|
|
1929
|
+
super("be a Node", ...args);
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
InvalidCSSError = class extends Error {
|
|
1933
|
+
constructor(received, matcherFn, context) {
|
|
1934
|
+
super();
|
|
1935
|
+
/* istanbul ignore next */
|
|
1936
|
+
if (Error.captureStackTrace) Error.captureStackTrace(this, matcherFn);
|
|
1937
|
+
this.message = [
|
|
1938
|
+
received.message,
|
|
1939
|
+
"",
|
|
1940
|
+
context.utils.RECEIVED_COLOR(`Failing css:`),
|
|
1941
|
+
context.utils.RECEIVED_COLOR(`${received.css}`)
|
|
1942
|
+
].join("\n");
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
rolesSupportingValues = [
|
|
1946
|
+
"meter",
|
|
1947
|
+
"progressbar",
|
|
1948
|
+
"slider",
|
|
1949
|
+
"spinbutton"
|
|
1950
|
+
];
|
|
1951
|
+
ariaInvalidName = "aria-invalid";
|
|
1952
|
+
validStates = ["false"];
|
|
1953
|
+
elementRoleList$1 = buildElementRoleList$1(import_lib$2.elementRoles);
|
|
1954
|
+
FORM_TAGS$2 = [
|
|
1955
|
+
"fieldset",
|
|
1956
|
+
"input",
|
|
1957
|
+
"select",
|
|
1958
|
+
"optgroup",
|
|
1959
|
+
"option",
|
|
1960
|
+
"button",
|
|
1961
|
+
"textarea"
|
|
1962
|
+
];
|
|
1963
|
+
FORM_TAGS$1 = ["select", "textarea"];
|
|
1964
|
+
ARIA_FORM_TAGS = [
|
|
1965
|
+
"input",
|
|
1966
|
+
"select",
|
|
1967
|
+
"textarea"
|
|
1968
|
+
];
|
|
1969
|
+
UNSUPPORTED_INPUT_TYPES = [
|
|
1970
|
+
"color",
|
|
1971
|
+
"hidden",
|
|
1972
|
+
"range",
|
|
1973
|
+
"submit",
|
|
1974
|
+
"image",
|
|
1975
|
+
"reset"
|
|
1976
|
+
];
|
|
1977
|
+
SUPPORTED_ARIA_ROLES = [
|
|
1978
|
+
"checkbox",
|
|
1979
|
+
"combobox",
|
|
1980
|
+
"gridcell",
|
|
1981
|
+
"listbox",
|
|
1982
|
+
"radiogroup",
|
|
1983
|
+
"spinbutton",
|
|
1984
|
+
"textbox",
|
|
1985
|
+
"tree"
|
|
1986
|
+
];
|
|
1987
|
+
FORM_TAGS = [
|
|
1988
|
+
"form",
|
|
1989
|
+
"input",
|
|
1990
|
+
"select",
|
|
1991
|
+
"textarea"
|
|
1992
|
+
];
|
|
1993
|
+
DOCUMENT_POSITION_DISCONNECTED = 1;
|
|
1994
|
+
DOCUMENT_POSITION_PRECEDING = 2;
|
|
1995
|
+
DOCUMENT_POSITION_FOLLOWING = 4;
|
|
1996
|
+
DOCUMENT_POSITION_CONTAINS = 8;
|
|
1997
|
+
DOCUMENT_POSITION_CONTAINED_BY = 16;
|
|
1998
|
+
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
|
|
1999
|
+
DOCUMENT_POSITIONS_STRINGS = {
|
|
2000
|
+
[DOCUMENT_POSITION_DISCONNECTED]: "Node.DOCUMENT_POSITION_DISCONNECTED",
|
|
2001
|
+
[DOCUMENT_POSITION_PRECEDING]: "Node.DOCUMENT_POSITION_PRECEDING",
|
|
2002
|
+
[DOCUMENT_POSITION_FOLLOWING]: "Node.DOCUMENT_POSITION_FOLLOWING",
|
|
2003
|
+
[DOCUMENT_POSITION_CONTAINS]: "Node.DOCUMENT_POSITION_CONTAINS",
|
|
2004
|
+
[DOCUMENT_POSITION_CONTAINED_BY]: "Node.DOCUMENT_POSITION_CONTAINED_BY",
|
|
2005
|
+
[DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC]: "Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC"
|
|
2006
|
+
};
|
|
2007
|
+
})))();
|
|
2008
|
+
}
|
|
2009
|
+
//#endregion
|
|
2010
|
+
//#region ../../node_modules/@testing-library/jest-dom/dist/matchers.mjs
|
|
2011
|
+
var matchers_exports = /* @__PURE__ */ __exportAll({
|
|
2012
|
+
toAppearAfter: () => toAppearAfter,
|
|
2013
|
+
toAppearBefore: () => toAppearBefore,
|
|
2014
|
+
toBeChecked: () => toBeChecked,
|
|
2015
|
+
toBeDisabled: () => toBeDisabled,
|
|
2016
|
+
toBeEmpty: () => toBeEmpty,
|
|
2017
|
+
toBeEmptyDOMElement: () => toBeEmptyDOMElement,
|
|
2018
|
+
toBeEnabled: () => toBeEnabled,
|
|
2019
|
+
toBeInTheDOM: () => toBeInTheDOM,
|
|
2020
|
+
toBeInTheDocument: () => toBeInTheDocument,
|
|
2021
|
+
toBeInvalid: () => toBeInvalid,
|
|
2022
|
+
toBePartiallyChecked: () => toBePartiallyChecked,
|
|
2023
|
+
toBePartiallyPressed: () => toBePartiallyPressed,
|
|
2024
|
+
toBePressed: () => toBePressed,
|
|
2025
|
+
toBeRequired: () => toBeRequired,
|
|
2026
|
+
toBeValid: () => toBeValid,
|
|
2027
|
+
toBeVisible: () => toBeVisible,
|
|
2028
|
+
toContainElement: () => toContainElement,
|
|
2029
|
+
toContainHTML: () => toContainHTML,
|
|
2030
|
+
toHaveAccessibleDescription: () => toHaveAccessibleDescription,
|
|
2031
|
+
toHaveAccessibleErrorMessage: () => toHaveAccessibleErrorMessage,
|
|
2032
|
+
toHaveAccessibleName: () => toHaveAccessibleName,
|
|
2033
|
+
toHaveAttribute: () => toHaveAttribute,
|
|
2034
|
+
toHaveClass: () => toHaveClass,
|
|
2035
|
+
toHaveDescription: () => toHaveDescription,
|
|
2036
|
+
toHaveDisplayValue: () => toHaveDisplayValue,
|
|
2037
|
+
toHaveErrorMessage: () => toHaveErrorMessage,
|
|
2038
|
+
toHaveFocus: () => toHaveFocus,
|
|
2039
|
+
toHaveFormValues: () => toHaveFormValues,
|
|
2040
|
+
toHaveRole: () => toHaveRole,
|
|
2041
|
+
toHaveSelection: () => toHaveSelection,
|
|
2042
|
+
toHaveStyle: () => toHaveStyle,
|
|
2043
|
+
toHaveTextContent: () => toHaveTextContent,
|
|
2044
|
+
toHaveValue: () => toHaveValue
|
|
2045
|
+
});
|
|
2046
|
+
function init_matchers() {
|
|
2047
|
+
return (init_matchers = __esmMin((() => {
|
|
2048
|
+
init_matchers_35e4d3bd();
|
|
2049
|
+
require_redent();
|
|
2050
|
+
init_dist();
|
|
2051
|
+
require_lib();
|
|
2052
|
+
require_css_escape();
|
|
2053
|
+
})))();
|
|
2054
|
+
}
|
|
2055
|
+
//#endregion
|
|
2056
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/node_modules/ansi-styles/index.js
|
|
2057
|
+
var require_ansi_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2058
|
+
const ANSI_BACKGROUND_OFFSET = 10;
|
|
2059
|
+
const wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
|
|
2060
|
+
const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
2061
|
+
function assembleStyles() {
|
|
2062
|
+
const codes = /* @__PURE__ */ new Map();
|
|
2063
|
+
const styles = {
|
|
2064
|
+
modifier: {
|
|
2065
|
+
reset: [0, 0],
|
|
2066
|
+
bold: [1, 22],
|
|
2067
|
+
dim: [2, 22],
|
|
2068
|
+
italic: [3, 23],
|
|
2069
|
+
underline: [4, 24],
|
|
2070
|
+
overline: [53, 55],
|
|
2071
|
+
inverse: [7, 27],
|
|
2072
|
+
hidden: [8, 28],
|
|
2073
|
+
strikethrough: [9, 29]
|
|
2074
|
+
},
|
|
2075
|
+
color: {
|
|
2076
|
+
black: [30, 39],
|
|
2077
|
+
red: [31, 39],
|
|
2078
|
+
green: [32, 39],
|
|
2079
|
+
yellow: [33, 39],
|
|
2080
|
+
blue: [34, 39],
|
|
2081
|
+
magenta: [35, 39],
|
|
2082
|
+
cyan: [36, 39],
|
|
2083
|
+
white: [37, 39],
|
|
2084
|
+
blackBright: [90, 39],
|
|
2085
|
+
redBright: [91, 39],
|
|
2086
|
+
greenBright: [92, 39],
|
|
2087
|
+
yellowBright: [93, 39],
|
|
2088
|
+
blueBright: [94, 39],
|
|
2089
|
+
magentaBright: [95, 39],
|
|
2090
|
+
cyanBright: [96, 39],
|
|
2091
|
+
whiteBright: [97, 39]
|
|
2092
|
+
},
|
|
2093
|
+
bgColor: {
|
|
2094
|
+
bgBlack: [40, 49],
|
|
2095
|
+
bgRed: [41, 49],
|
|
2096
|
+
bgGreen: [42, 49],
|
|
2097
|
+
bgYellow: [43, 49],
|
|
2098
|
+
bgBlue: [44, 49],
|
|
2099
|
+
bgMagenta: [45, 49],
|
|
2100
|
+
bgCyan: [46, 49],
|
|
2101
|
+
bgWhite: [47, 49],
|
|
2102
|
+
bgBlackBright: [100, 49],
|
|
2103
|
+
bgRedBright: [101, 49],
|
|
2104
|
+
bgGreenBright: [102, 49],
|
|
2105
|
+
bgYellowBright: [103, 49],
|
|
2106
|
+
bgBlueBright: [104, 49],
|
|
2107
|
+
bgMagentaBright: [105, 49],
|
|
2108
|
+
bgCyanBright: [106, 49],
|
|
2109
|
+
bgWhiteBright: [107, 49]
|
|
2110
|
+
}
|
|
2111
|
+
};
|
|
2112
|
+
styles.color.gray = styles.color.blackBright;
|
|
2113
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
2114
|
+
styles.color.grey = styles.color.blackBright;
|
|
2115
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
2116
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
2117
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
2118
|
+
styles[styleName] = {
|
|
2119
|
+
open: `\u001B[${style[0]}m`,
|
|
2120
|
+
close: `\u001B[${style[1]}m`
|
|
2121
|
+
};
|
|
2122
|
+
group[styleName] = styles[styleName];
|
|
2123
|
+
codes.set(style[0], style[1]);
|
|
2124
|
+
}
|
|
2125
|
+
Object.defineProperty(styles, groupName, {
|
|
2126
|
+
value: group,
|
|
2127
|
+
enumerable: false
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
Object.defineProperty(styles, "codes", {
|
|
2131
|
+
value: codes,
|
|
2132
|
+
enumerable: false
|
|
2133
|
+
});
|
|
2134
|
+
styles.color.close = "\x1B[39m";
|
|
2135
|
+
styles.bgColor.close = "\x1B[49m";
|
|
2136
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
2137
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
2138
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
2139
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
2140
|
+
Object.defineProperties(styles, {
|
|
2141
|
+
rgbToAnsi256: {
|
|
2142
|
+
value: (red, green, blue) => {
|
|
2143
|
+
if (red === green && green === blue) {
|
|
2144
|
+
if (red < 8) return 16;
|
|
2145
|
+
if (red > 248) return 231;
|
|
2146
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
2147
|
+
}
|
|
2148
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
2149
|
+
},
|
|
2150
|
+
enumerable: false
|
|
2151
|
+
},
|
|
2152
|
+
hexToRgb: {
|
|
2153
|
+
value: (hex) => {
|
|
2154
|
+
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
|
2155
|
+
if (!matches) return [
|
|
2156
|
+
0,
|
|
2157
|
+
0,
|
|
2158
|
+
0
|
|
2159
|
+
];
|
|
2160
|
+
let { colorString } = matches.groups;
|
|
2161
|
+
if (colorString.length === 3) colorString = colorString.split("").map((character) => character + character).join("");
|
|
2162
|
+
const integer = Number.parseInt(colorString, 16);
|
|
2163
|
+
return [
|
|
2164
|
+
integer >> 16 & 255,
|
|
2165
|
+
integer >> 8 & 255,
|
|
2166
|
+
integer & 255
|
|
2167
|
+
];
|
|
2168
|
+
},
|
|
2169
|
+
enumerable: false
|
|
2170
|
+
},
|
|
2171
|
+
hexToAnsi256: {
|
|
2172
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
2173
|
+
enumerable: false
|
|
2174
|
+
}
|
|
2175
|
+
});
|
|
2176
|
+
return styles;
|
|
2177
|
+
}
|
|
2178
|
+
Object.defineProperty(module, "exports", {
|
|
2179
|
+
enumerable: true,
|
|
2180
|
+
get: assembleStyles
|
|
2181
|
+
});
|
|
2182
|
+
}));
|
|
2183
|
+
//#endregion
|
|
2184
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/collections.js
|
|
2185
|
+
var require_collections = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2186
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2187
|
+
exports.printIteratorEntries = printIteratorEntries;
|
|
2188
|
+
exports.printIteratorValues = printIteratorValues;
|
|
2189
|
+
exports.printListItems = printListItems;
|
|
2190
|
+
exports.printObjectProperties = printObjectProperties;
|
|
2191
|
+
/**
|
|
2192
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2193
|
+
*
|
|
2194
|
+
* This source code is licensed under the MIT license found in the
|
|
2195
|
+
* LICENSE file in the root directory of this source tree.
|
|
2196
|
+
*
|
|
2197
|
+
*/
|
|
2198
|
+
const getKeysOfEnumerableProperties = (object, compareKeys) => {
|
|
2199
|
+
const keys = Object.keys(object).sort(compareKeys);
|
|
2200
|
+
if (Object.getOwnPropertySymbols) Object.getOwnPropertySymbols(object).forEach((symbol) => {
|
|
2201
|
+
if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) keys.push(symbol);
|
|
2202
|
+
});
|
|
2203
|
+
return keys;
|
|
2204
|
+
};
|
|
2205
|
+
/**
|
|
2206
|
+
* Return entries (for example, of a map)
|
|
2207
|
+
* with spacing, indentation, and comma
|
|
2208
|
+
* without surrounding punctuation (for example, braces)
|
|
2209
|
+
*/
|
|
2210
|
+
function printIteratorEntries(iterator, config, indentation, depth, refs, printer, separator = ": ") {
|
|
2211
|
+
let result = "";
|
|
2212
|
+
let current = iterator.next();
|
|
2213
|
+
if (!current.done) {
|
|
2214
|
+
result += config.spacingOuter;
|
|
2215
|
+
const indentationNext = indentation + config.indent;
|
|
2216
|
+
while (!current.done) {
|
|
2217
|
+
const name = printer(current.value[0], config, indentationNext, depth, refs);
|
|
2218
|
+
const value = printer(current.value[1], config, indentationNext, depth, refs);
|
|
2219
|
+
result += indentationNext + name + separator + value;
|
|
2220
|
+
current = iterator.next();
|
|
2221
|
+
if (!current.done) result += "," + config.spacingInner;
|
|
2222
|
+
else if (!config.min) result += ",";
|
|
2223
|
+
}
|
|
2224
|
+
result += config.spacingOuter + indentation;
|
|
2225
|
+
}
|
|
2226
|
+
return result;
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Return values (for example, of a set)
|
|
2230
|
+
* with spacing, indentation, and comma
|
|
2231
|
+
* without surrounding punctuation (braces or brackets)
|
|
2232
|
+
*/
|
|
2233
|
+
function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
|
|
2234
|
+
let result = "";
|
|
2235
|
+
let current = iterator.next();
|
|
2236
|
+
if (!current.done) {
|
|
2237
|
+
result += config.spacingOuter;
|
|
2238
|
+
const indentationNext = indentation + config.indent;
|
|
2239
|
+
while (!current.done) {
|
|
2240
|
+
result += indentationNext + printer(current.value, config, indentationNext, depth, refs);
|
|
2241
|
+
current = iterator.next();
|
|
2242
|
+
if (!current.done) result += "," + config.spacingInner;
|
|
2243
|
+
else if (!config.min) result += ",";
|
|
2244
|
+
}
|
|
2245
|
+
result += config.spacingOuter + indentation;
|
|
2246
|
+
}
|
|
2247
|
+
return result;
|
|
2248
|
+
}
|
|
2249
|
+
/**
|
|
2250
|
+
* Return items (for example, of an array)
|
|
2251
|
+
* with spacing, indentation, and comma
|
|
2252
|
+
* without surrounding punctuation (for example, brackets)
|
|
2253
|
+
**/
|
|
2254
|
+
function printListItems(list, config, indentation, depth, refs, printer) {
|
|
2255
|
+
let result = "";
|
|
2256
|
+
if (list.length) {
|
|
2257
|
+
result += config.spacingOuter;
|
|
2258
|
+
const indentationNext = indentation + config.indent;
|
|
2259
|
+
for (let i = 0; i < list.length; i++) {
|
|
2260
|
+
result += indentationNext;
|
|
2261
|
+
if (i in list) result += printer(list[i], config, indentationNext, depth, refs);
|
|
2262
|
+
if (i < list.length - 1) result += "," + config.spacingInner;
|
|
2263
|
+
else if (!config.min) result += ",";
|
|
2264
|
+
}
|
|
2265
|
+
result += config.spacingOuter + indentation;
|
|
2266
|
+
}
|
|
2267
|
+
return result;
|
|
2268
|
+
}
|
|
2269
|
+
/**
|
|
2270
|
+
* Return properties of an object
|
|
2271
|
+
* with spacing, indentation, and comma
|
|
2272
|
+
* without surrounding punctuation (for example, braces)
|
|
2273
|
+
*/
|
|
2274
|
+
function printObjectProperties(val, config, indentation, depth, refs, printer) {
|
|
2275
|
+
let result = "";
|
|
2276
|
+
const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
|
|
2277
|
+
if (keys.length) {
|
|
2278
|
+
result += config.spacingOuter;
|
|
2279
|
+
const indentationNext = indentation + config.indent;
|
|
2280
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2281
|
+
const key = keys[i];
|
|
2282
|
+
const name = printer(key, config, indentationNext, depth, refs);
|
|
2283
|
+
const value = printer(val[key], config, indentationNext, depth, refs);
|
|
2284
|
+
result += indentationNext + name + ": " + value;
|
|
2285
|
+
if (i < keys.length - 1) result += "," + config.spacingInner;
|
|
2286
|
+
else if (!config.min) result += ",";
|
|
2287
|
+
}
|
|
2288
|
+
result += config.spacingOuter + indentation;
|
|
2289
|
+
}
|
|
2290
|
+
return result;
|
|
2291
|
+
}
|
|
2292
|
+
}));
|
|
2293
|
+
//#endregion
|
|
2294
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/AsymmetricMatcher.js
|
|
2295
|
+
var require_AsymmetricMatcher = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2296
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2297
|
+
exports.test = exports.serialize = exports.default = void 0;
|
|
2298
|
+
var _collections = require_collections();
|
|
2299
|
+
var global = (function() {
|
|
2300
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
2301
|
+
else if (typeof global !== "undefined") return global;
|
|
2302
|
+
else if (typeof self !== "undefined") return self;
|
|
2303
|
+
else if (typeof window !== "undefined") return window;
|
|
2304
|
+
else return Function("return this")();
|
|
2305
|
+
})();
|
|
2306
|
+
var Symbol = global["jest-symbol-do-not-touch"] || global.Symbol;
|
|
2307
|
+
const asymmetricMatcher = typeof Symbol === "function" && Symbol.for ? Symbol.for("jest.asymmetricMatcher") : 1267621;
|
|
2308
|
+
const SPACE = " ";
|
|
2309
|
+
const serialize = (val, config, indentation, depth, refs, printer) => {
|
|
2310
|
+
const stringedValue = val.toString();
|
|
2311
|
+
if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining") {
|
|
2312
|
+
if (++depth > config.maxDepth) return "[" + stringedValue + "]";
|
|
2313
|
+
return stringedValue + " [" + (0, _collections.printListItems)(val.sample, config, indentation, depth, refs, printer) + "]";
|
|
2314
|
+
}
|
|
2315
|
+
if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining") {
|
|
2316
|
+
if (++depth > config.maxDepth) return "[" + stringedValue + "]";
|
|
2317
|
+
return stringedValue + " {" + (0, _collections.printObjectProperties)(val.sample, config, indentation, depth, refs, printer) + "}";
|
|
2318
|
+
}
|
|
2319
|
+
if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching") return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
|
|
2320
|
+
if (stringedValue === "StringContaining" || stringedValue === "StringNotContaining") return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
|
|
2321
|
+
return val.toAsymmetricMatcher();
|
|
2322
|
+
};
|
|
2323
|
+
exports.serialize = serialize;
|
|
2324
|
+
const test = (val) => val && val.$$typeof === asymmetricMatcher;
|
|
2325
|
+
exports.test = test;
|
|
2326
|
+
exports.default = {
|
|
2327
|
+
serialize,
|
|
2328
|
+
test
|
|
2329
|
+
};
|
|
2330
|
+
}));
|
|
2331
|
+
//#endregion
|
|
2332
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/ConvertAnsi.js
|
|
2333
|
+
var require_ConvertAnsi = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2334
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2335
|
+
exports.test = exports.serialize = exports.default = void 0;
|
|
2336
|
+
var _ansiRegex = _interopRequireDefault(require_ansi_regex());
|
|
2337
|
+
var _ansiStyles = _interopRequireDefault(require_ansi_styles());
|
|
2338
|
+
function _interopRequireDefault(obj) {
|
|
2339
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2343
|
+
*
|
|
2344
|
+
* This source code is licensed under the MIT license found in the
|
|
2345
|
+
* LICENSE file in the root directory of this source tree.
|
|
2346
|
+
*/
|
|
2347
|
+
const toHumanReadableAnsi = (text) => text.replace((0, _ansiRegex.default)(), (match) => {
|
|
2348
|
+
switch (match) {
|
|
2349
|
+
case _ansiStyles.default.red.close:
|
|
2350
|
+
case _ansiStyles.default.green.close:
|
|
2351
|
+
case _ansiStyles.default.cyan.close:
|
|
2352
|
+
case _ansiStyles.default.gray.close:
|
|
2353
|
+
case _ansiStyles.default.white.close:
|
|
2354
|
+
case _ansiStyles.default.yellow.close:
|
|
2355
|
+
case _ansiStyles.default.bgRed.close:
|
|
2356
|
+
case _ansiStyles.default.bgGreen.close:
|
|
2357
|
+
case _ansiStyles.default.bgYellow.close:
|
|
2358
|
+
case _ansiStyles.default.inverse.close:
|
|
2359
|
+
case _ansiStyles.default.dim.close:
|
|
2360
|
+
case _ansiStyles.default.bold.close:
|
|
2361
|
+
case _ansiStyles.default.reset.open:
|
|
2362
|
+
case _ansiStyles.default.reset.close: return "</>";
|
|
2363
|
+
case _ansiStyles.default.red.open: return "<red>";
|
|
2364
|
+
case _ansiStyles.default.green.open: return "<green>";
|
|
2365
|
+
case _ansiStyles.default.cyan.open: return "<cyan>";
|
|
2366
|
+
case _ansiStyles.default.gray.open: return "<gray>";
|
|
2367
|
+
case _ansiStyles.default.white.open: return "<white>";
|
|
2368
|
+
case _ansiStyles.default.yellow.open: return "<yellow>";
|
|
2369
|
+
case _ansiStyles.default.bgRed.open: return "<bgRed>";
|
|
2370
|
+
case _ansiStyles.default.bgGreen.open: return "<bgGreen>";
|
|
2371
|
+
case _ansiStyles.default.bgYellow.open: return "<bgYellow>";
|
|
2372
|
+
case _ansiStyles.default.inverse.open: return "<inverse>";
|
|
2373
|
+
case _ansiStyles.default.dim.open: return "<dim>";
|
|
2374
|
+
case _ansiStyles.default.bold.open: return "<bold>";
|
|
2375
|
+
default: return "";
|
|
2376
|
+
}
|
|
2377
|
+
});
|
|
2378
|
+
const test = (val) => typeof val === "string" && !!val.match((0, _ansiRegex.default)());
|
|
2379
|
+
exports.test = test;
|
|
2380
|
+
const serialize = (val, config, indentation, depth, refs, printer) => printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
|
|
2381
|
+
exports.serialize = serialize;
|
|
2382
|
+
exports.default = {
|
|
2383
|
+
serialize,
|
|
2384
|
+
test
|
|
2385
|
+
};
|
|
2386
|
+
}));
|
|
2387
|
+
//#endregion
|
|
2388
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/DOMCollection.js
|
|
2389
|
+
var require_DOMCollection = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2390
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2391
|
+
exports.test = exports.serialize = exports.default = void 0;
|
|
2392
|
+
var _collections = require_collections();
|
|
2393
|
+
/**
|
|
2394
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2395
|
+
*
|
|
2396
|
+
* This source code is licensed under the MIT license found in the
|
|
2397
|
+
* LICENSE file in the root directory of this source tree.
|
|
2398
|
+
*/
|
|
2399
|
+
const SPACE = " ";
|
|
2400
|
+
const OBJECT_NAMES = ["DOMStringMap", "NamedNodeMap"];
|
|
2401
|
+
const ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/;
|
|
2402
|
+
const testName = (name) => OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name);
|
|
2403
|
+
const test = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
|
|
2404
|
+
exports.test = test;
|
|
2405
|
+
const isNamedNodeMap = (collection) => collection.constructor.name === "NamedNodeMap";
|
|
2406
|
+
const serialize = (collection, config, indentation, depth, refs, printer) => {
|
|
2407
|
+
const name = collection.constructor.name;
|
|
2408
|
+
if (++depth > config.maxDepth) return "[" + name + "]";
|
|
2409
|
+
return (config.min ? "" : name + SPACE) + (OBJECT_NAMES.indexOf(name) !== -1 ? "{" + (0, _collections.printObjectProperties)(isNamedNodeMap(collection) ? Array.from(collection).reduce((props, attribute) => {
|
|
2410
|
+
props[attribute.name] = attribute.value;
|
|
2411
|
+
return props;
|
|
2412
|
+
}, {}) : { ...collection }, config, indentation, depth, refs, printer) + "}" : "[" + (0, _collections.printListItems)(Array.from(collection), config, indentation, depth, refs, printer) + "]");
|
|
2413
|
+
};
|
|
2414
|
+
exports.serialize = serialize;
|
|
2415
|
+
exports.default = {
|
|
2416
|
+
serialize,
|
|
2417
|
+
test
|
|
2418
|
+
};
|
|
2419
|
+
}));
|
|
2420
|
+
//#endregion
|
|
2421
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/lib/escapeHTML.js
|
|
2422
|
+
var require_escapeHTML = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2423
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2424
|
+
exports.default = escapeHTML;
|
|
2425
|
+
/**
|
|
2426
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2427
|
+
*
|
|
2428
|
+
* This source code is licensed under the MIT license found in the
|
|
2429
|
+
* LICENSE file in the root directory of this source tree.
|
|
2430
|
+
*/
|
|
2431
|
+
function escapeHTML(str) {
|
|
2432
|
+
return str.replace(/</g, "<").replace(/>/g, ">");
|
|
2433
|
+
}
|
|
2434
|
+
}));
|
|
2435
|
+
//#endregion
|
|
2436
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/lib/markup.js
|
|
2437
|
+
var require_markup = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2438
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2439
|
+
exports.printText = exports.printProps = exports.printElementAsLeaf = exports.printElement = exports.printComment = exports.printChildren = void 0;
|
|
2440
|
+
var _escapeHTML = _interopRequireDefault(require_escapeHTML());
|
|
2441
|
+
function _interopRequireDefault(obj) {
|
|
2442
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
2443
|
+
}
|
|
2444
|
+
/**
|
|
2445
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2446
|
+
*
|
|
2447
|
+
* This source code is licensed under the MIT license found in the
|
|
2448
|
+
* LICENSE file in the root directory of this source tree.
|
|
2449
|
+
*/
|
|
2450
|
+
const printProps = (keys, props, config, indentation, depth, refs, printer) => {
|
|
2451
|
+
const indentationNext = indentation + config.indent;
|
|
2452
|
+
const colors = config.colors;
|
|
2453
|
+
return keys.map((key) => {
|
|
2454
|
+
const value = props[key];
|
|
2455
|
+
let printed = printer(value, config, indentationNext, depth, refs);
|
|
2456
|
+
if (typeof value !== "string") {
|
|
2457
|
+
if (printed.indexOf("\n") !== -1) printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
|
|
2458
|
+
printed = "{" + printed + "}";
|
|
2459
|
+
}
|
|
2460
|
+
return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + "=" + colors.value.open + printed + colors.value.close;
|
|
2461
|
+
}).join("");
|
|
2462
|
+
};
|
|
2463
|
+
exports.printProps = printProps;
|
|
2464
|
+
const printChildren = (children, config, indentation, depth, refs, printer) => children.map((child) => config.spacingOuter + indentation + (typeof child === "string" ? printText(child, config) : printer(child, config, indentation, depth, refs))).join("");
|
|
2465
|
+
exports.printChildren = printChildren;
|
|
2466
|
+
const printText = (text, config) => {
|
|
2467
|
+
const contentColor = config.colors.content;
|
|
2468
|
+
return contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close;
|
|
2469
|
+
};
|
|
2470
|
+
exports.printText = printText;
|
|
2471
|
+
const printComment = (comment, config) => {
|
|
2472
|
+
const commentColor = config.colors.comment;
|
|
2473
|
+
return commentColor.open + "<!--" + (0, _escapeHTML.default)(comment) + "-->" + commentColor.close;
|
|
2474
|
+
};
|
|
2475
|
+
exports.printComment = printComment;
|
|
2476
|
+
const printElement = (type, printedProps, printedChildren, config, indentation) => {
|
|
2477
|
+
const tagColor = config.colors.tag;
|
|
2478
|
+
return tagColor.open + "<" + type + (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) + (printedChildren ? ">" + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + "</" + type : (printedProps && !config.min ? "" : " ") + "/") + ">" + tagColor.close;
|
|
2479
|
+
};
|
|
2480
|
+
exports.printElement = printElement;
|
|
2481
|
+
const printElementAsLeaf = (type, config) => {
|
|
2482
|
+
const tagColor = config.colors.tag;
|
|
2483
|
+
return tagColor.open + "<" + type + tagColor.close + " …" + tagColor.open + " />" + tagColor.close;
|
|
2484
|
+
};
|
|
2485
|
+
exports.printElementAsLeaf = printElementAsLeaf;
|
|
2486
|
+
}));
|
|
2487
|
+
//#endregion
|
|
2488
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/DOMElement.js
|
|
2489
|
+
var require_DOMElement = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2490
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2491
|
+
exports.test = exports.serialize = exports.default = void 0;
|
|
2492
|
+
var _markup = require_markup();
|
|
2493
|
+
/**
|
|
2494
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2495
|
+
*
|
|
2496
|
+
* This source code is licensed under the MIT license found in the
|
|
2497
|
+
* LICENSE file in the root directory of this source tree.
|
|
2498
|
+
*/
|
|
2499
|
+
const ELEMENT_NODE = 1;
|
|
2500
|
+
const TEXT_NODE = 3;
|
|
2501
|
+
const COMMENT_NODE = 8;
|
|
2502
|
+
const FRAGMENT_NODE = 11;
|
|
2503
|
+
const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
|
|
2504
|
+
const testHasAttribute = (val) => {
|
|
2505
|
+
try {
|
|
2506
|
+
return typeof val.hasAttribute === "function" && val.hasAttribute("is");
|
|
2507
|
+
} catch {
|
|
2508
|
+
return false;
|
|
2509
|
+
}
|
|
2510
|
+
};
|
|
2511
|
+
const testNode = (val) => {
|
|
2512
|
+
const constructorName = val.constructor.name;
|
|
2513
|
+
const { nodeType, tagName } = val;
|
|
2514
|
+
const isCustomElement = typeof tagName === "string" && tagName.includes("-") || testHasAttribute(val);
|
|
2515
|
+
return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
|
|
2516
|
+
};
|
|
2517
|
+
const test = (val) => {
|
|
2518
|
+
var _val$constructor;
|
|
2519
|
+
return (val === null || val === void 0 ? void 0 : (_val$constructor = val.constructor) === null || _val$constructor === void 0 ? void 0 : _val$constructor.name) && testNode(val);
|
|
2520
|
+
};
|
|
2521
|
+
exports.test = test;
|
|
2522
|
+
function nodeIsText(node) {
|
|
2523
|
+
return node.nodeType === TEXT_NODE;
|
|
2524
|
+
}
|
|
2525
|
+
function nodeIsComment(node) {
|
|
2526
|
+
return node.nodeType === COMMENT_NODE;
|
|
2527
|
+
}
|
|
2528
|
+
function nodeIsFragment(node) {
|
|
2529
|
+
return node.nodeType === FRAGMENT_NODE;
|
|
2530
|
+
}
|
|
2531
|
+
const serialize = (node, config, indentation, depth, refs, printer) => {
|
|
2532
|
+
if (nodeIsText(node)) return (0, _markup.printText)(node.data, config);
|
|
2533
|
+
if (nodeIsComment(node)) return (0, _markup.printComment)(node.data, config);
|
|
2534
|
+
const type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
|
|
2535
|
+
if (++depth > config.maxDepth) return (0, _markup.printElementAsLeaf)(type, config);
|
|
2536
|
+
return (0, _markup.printElement)(type, (0, _markup.printProps)(nodeIsFragment(node) ? [] : Array.from(node.attributes).map((attr) => attr.name).sort(), nodeIsFragment(node) ? {} : Array.from(node.attributes).reduce((props, attribute) => {
|
|
2537
|
+
props[attribute.name] = attribute.value;
|
|
2538
|
+
return props;
|
|
2539
|
+
}, {}), config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
|
|
2540
|
+
};
|
|
2541
|
+
exports.serialize = serialize;
|
|
2542
|
+
exports.default = {
|
|
2543
|
+
serialize,
|
|
2544
|
+
test
|
|
2545
|
+
};
|
|
2546
|
+
}));
|
|
2547
|
+
//#endregion
|
|
2548
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/Immutable.js
|
|
2549
|
+
var require_Immutable = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2550
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2551
|
+
exports.test = exports.serialize = exports.default = void 0;
|
|
2552
|
+
var _collections = require_collections();
|
|
2553
|
+
/**
|
|
2554
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2555
|
+
*
|
|
2556
|
+
* This source code is licensed under the MIT license found in the
|
|
2557
|
+
* LICENSE file in the root directory of this source tree.
|
|
2558
|
+
*/
|
|
2559
|
+
const IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
2560
|
+
const IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@";
|
|
2561
|
+
const IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
|
|
2562
|
+
const IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@";
|
|
2563
|
+
const IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
|
|
2564
|
+
const IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@";
|
|
2565
|
+
const IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
|
|
2566
|
+
const IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
|
|
2567
|
+
const IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@";
|
|
2568
|
+
const getImmutableName = (name) => "Immutable." + name;
|
|
2569
|
+
const printAsLeaf = (name) => "[" + name + "]";
|
|
2570
|
+
const LAZY = "…";
|
|
2571
|
+
const printImmutableEntries = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + " {" + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) + "}";
|
|
2572
|
+
function getRecordEntries(val) {
|
|
2573
|
+
let i = 0;
|
|
2574
|
+
return { next() {
|
|
2575
|
+
if (i < val._keys.length) {
|
|
2576
|
+
const key = val._keys[i++];
|
|
2577
|
+
return {
|
|
2578
|
+
done: false,
|
|
2579
|
+
value: [key, val.get(key)]
|
|
2580
|
+
};
|
|
2581
|
+
}
|
|
2582
|
+
return {
|
|
2583
|
+
done: true,
|
|
2584
|
+
value: void 0
|
|
2585
|
+
};
|
|
2586
|
+
} };
|
|
2587
|
+
}
|
|
2588
|
+
const printImmutableRecord = (val, config, indentation, depth, refs, printer) => {
|
|
2589
|
+
const name = getImmutableName(val._name || "Record");
|
|
2590
|
+
return ++depth > config.maxDepth ? printAsLeaf(name) : name + " {" + (0, _collections.printIteratorEntries)(getRecordEntries(val), config, indentation, depth, refs, printer) + "}";
|
|
2591
|
+
};
|
|
2592
|
+
const printImmutableSeq = (val, config, indentation, depth, refs, printer) => {
|
|
2593
|
+
const name = getImmutableName("Seq");
|
|
2594
|
+
if (++depth > config.maxDepth) return printAsLeaf(name);
|
|
2595
|
+
if (val[IS_KEYED_SENTINEL]) return name + " {" + (val._iter || val._object ? (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) : LAZY) + "}";
|
|
2596
|
+
return name + " [" + (val._iter || val._array || val._collection || val._iterable ? (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) : LAZY) + "]";
|
|
2597
|
+
};
|
|
2598
|
+
const printImmutableValues = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + " [" + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + "]";
|
|
2599
|
+
const serialize = (val, config, indentation, depth, refs, printer) => {
|
|
2600
|
+
if (val[IS_MAP_SENTINEL]) return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map");
|
|
2601
|
+
if (val[IS_LIST_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, "List");
|
|
2602
|
+
if (val[IS_SET_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set");
|
|
2603
|
+
if (val[IS_STACK_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, "Stack");
|
|
2604
|
+
if (val[IS_SEQ_SENTINEL]) return printImmutableSeq(val, config, indentation, depth, refs, printer);
|
|
2605
|
+
return printImmutableRecord(val, config, indentation, depth, refs, printer);
|
|
2606
|
+
};
|
|
2607
|
+
exports.serialize = serialize;
|
|
2608
|
+
const test = (val) => val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
|
|
2609
|
+
exports.test = test;
|
|
2610
|
+
exports.default = {
|
|
2611
|
+
serialize,
|
|
2612
|
+
test
|
|
2613
|
+
};
|
|
2614
|
+
}));
|
|
2615
|
+
//#endregion
|
|
2616
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/node_modules/react-is/cjs/react-is.production.min.js
|
|
2617
|
+
/** @license React v17.0.2
|
|
2618
|
+
* react-is.production.min.js
|
|
2619
|
+
*
|
|
2620
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
2621
|
+
*
|
|
2622
|
+
* This source code is licensed under the MIT license found in the
|
|
2623
|
+
* LICENSE file in the root directory of this source tree.
|
|
2624
|
+
*/
|
|
2625
|
+
var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2626
|
+
var b = 60103;
|
|
2627
|
+
var c = 60106;
|
|
2628
|
+
var d = 60107;
|
|
2629
|
+
var e = 60108;
|
|
2630
|
+
var f = 60114;
|
|
2631
|
+
var g = 60109;
|
|
2632
|
+
var h = 60110;
|
|
2633
|
+
var k = 60112;
|
|
2634
|
+
var l = 60113;
|
|
2635
|
+
var m = 60120;
|
|
2636
|
+
var n = 60115;
|
|
2637
|
+
var p = 60116;
|
|
2638
|
+
var q = 60121;
|
|
2639
|
+
var r = 60122;
|
|
2640
|
+
var u = 60117;
|
|
2641
|
+
var v = 60129;
|
|
2642
|
+
var w = 60131;
|
|
2643
|
+
if ("function" === typeof Symbol && Symbol.for) {
|
|
2644
|
+
var x = Symbol.for;
|
|
2645
|
+
b = x("react.element");
|
|
2646
|
+
c = x("react.portal");
|
|
2647
|
+
d = x("react.fragment");
|
|
2648
|
+
e = x("react.strict_mode");
|
|
2649
|
+
f = x("react.profiler");
|
|
2650
|
+
g = x("react.provider");
|
|
2651
|
+
h = x("react.context");
|
|
2652
|
+
k = x("react.forward_ref");
|
|
2653
|
+
l = x("react.suspense");
|
|
2654
|
+
m = x("react.suspense_list");
|
|
2655
|
+
n = x("react.memo");
|
|
2656
|
+
p = x("react.lazy");
|
|
2657
|
+
q = x("react.block");
|
|
2658
|
+
r = x("react.server.block");
|
|
2659
|
+
u = x("react.fundamental");
|
|
2660
|
+
v = x("react.debug_trace_mode");
|
|
2661
|
+
w = x("react.legacy_hidden");
|
|
2662
|
+
}
|
|
2663
|
+
function y(a) {
|
|
2664
|
+
if ("object" === typeof a && null !== a) {
|
|
2665
|
+
var t = a.$$typeof;
|
|
2666
|
+
switch (t) {
|
|
2667
|
+
case b: switch (a = a.type, a) {
|
|
2668
|
+
case d:
|
|
2669
|
+
case f:
|
|
2670
|
+
case e:
|
|
2671
|
+
case l:
|
|
2672
|
+
case m: return a;
|
|
2673
|
+
default: switch (a = a && a.$$typeof, a) {
|
|
2674
|
+
case h:
|
|
2675
|
+
case k:
|
|
2676
|
+
case p:
|
|
2677
|
+
case n:
|
|
2678
|
+
case g: return a;
|
|
2679
|
+
default: return t;
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
case c: return t;
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
var z = g;
|
|
2687
|
+
var A = b;
|
|
2688
|
+
var B = k;
|
|
2689
|
+
var C = d;
|
|
2690
|
+
var D = p;
|
|
2691
|
+
var E = n;
|
|
2692
|
+
var F = c;
|
|
2693
|
+
var G = f;
|
|
2694
|
+
var H = e;
|
|
2695
|
+
var I = l;
|
|
2696
|
+
exports.ContextConsumer = h;
|
|
2697
|
+
exports.ContextProvider = z;
|
|
2698
|
+
exports.Element = A;
|
|
2699
|
+
exports.ForwardRef = B;
|
|
2700
|
+
exports.Fragment = C;
|
|
2701
|
+
exports.Lazy = D;
|
|
2702
|
+
exports.Memo = E;
|
|
2703
|
+
exports.Portal = F;
|
|
2704
|
+
exports.Profiler = G;
|
|
2705
|
+
exports.StrictMode = H;
|
|
2706
|
+
exports.Suspense = I;
|
|
2707
|
+
exports.isAsyncMode = function() {
|
|
2708
|
+
return !1;
|
|
2709
|
+
};
|
|
2710
|
+
exports.isConcurrentMode = function() {
|
|
2711
|
+
return !1;
|
|
2712
|
+
};
|
|
2713
|
+
exports.isContextConsumer = function(a) {
|
|
2714
|
+
return y(a) === h;
|
|
2715
|
+
};
|
|
2716
|
+
exports.isContextProvider = function(a) {
|
|
2717
|
+
return y(a) === g;
|
|
2718
|
+
};
|
|
2719
|
+
exports.isElement = function(a) {
|
|
2720
|
+
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
2721
|
+
};
|
|
2722
|
+
exports.isForwardRef = function(a) {
|
|
2723
|
+
return y(a) === k;
|
|
2724
|
+
};
|
|
2725
|
+
exports.isFragment = function(a) {
|
|
2726
|
+
return y(a) === d;
|
|
2727
|
+
};
|
|
2728
|
+
exports.isLazy = function(a) {
|
|
2729
|
+
return y(a) === p;
|
|
2730
|
+
};
|
|
2731
|
+
exports.isMemo = function(a) {
|
|
2732
|
+
return y(a) === n;
|
|
2733
|
+
};
|
|
2734
|
+
exports.isPortal = function(a) {
|
|
2735
|
+
return y(a) === c;
|
|
2736
|
+
};
|
|
2737
|
+
exports.isProfiler = function(a) {
|
|
2738
|
+
return y(a) === f;
|
|
2739
|
+
};
|
|
2740
|
+
exports.isStrictMode = function(a) {
|
|
2741
|
+
return y(a) === e;
|
|
2742
|
+
};
|
|
2743
|
+
exports.isSuspense = function(a) {
|
|
2744
|
+
return y(a) === l;
|
|
2745
|
+
};
|
|
2746
|
+
exports.isValidElementType = function(a) {
|
|
2747
|
+
return "string" === typeof a || "function" === typeof a || a === d || a === f || a === v || a === e || a === l || a === m || a === w || "object" === typeof a && null !== a && (a.$$typeof === p || a.$$typeof === n || a.$$typeof === g || a.$$typeof === h || a.$$typeof === k || a.$$typeof === u || a.$$typeof === q || a[0] === r) ? !0 : !1;
|
|
2748
|
+
};
|
|
2749
|
+
exports.typeOf = y;
|
|
2750
|
+
}));
|
|
2751
|
+
//#endregion
|
|
2752
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/node_modules/react-is/index.js
|
|
2753
|
+
var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2754
|
+
module.exports = require_react_is_production_min();
|
|
2755
|
+
}));
|
|
2756
|
+
//#endregion
|
|
2757
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/ReactElement.js
|
|
2758
|
+
var require_ReactElement = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2759
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2760
|
+
exports.test = exports.serialize = exports.default = void 0;
|
|
2761
|
+
var ReactIs = _interopRequireWildcard(require_react_is());
|
|
2762
|
+
var _markup = require_markup();
|
|
2763
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
2764
|
+
if (typeof WeakMap !== "function") return null;
|
|
2765
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
2766
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
2767
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
2768
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
2769
|
+
})(nodeInterop);
|
|
2770
|
+
}
|
|
2771
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
2772
|
+
if (!nodeInterop && obj && obj.__esModule) return obj;
|
|
2773
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
|
|
2774
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
2775
|
+
if (cache && cache.has(obj)) return cache.get(obj);
|
|
2776
|
+
var newObj = {};
|
|
2777
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
2778
|
+
for (var key in obj) if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2779
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
2780
|
+
if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
|
|
2781
|
+
else newObj[key] = obj[key];
|
|
2782
|
+
}
|
|
2783
|
+
newObj.default = obj;
|
|
2784
|
+
if (cache) cache.set(obj, newObj);
|
|
2785
|
+
return newObj;
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2789
|
+
*
|
|
2790
|
+
* This source code is licensed under the MIT license found in the
|
|
2791
|
+
* LICENSE file in the root directory of this source tree.
|
|
2792
|
+
*/
|
|
2793
|
+
const getChildren = (arg, children = []) => {
|
|
2794
|
+
if (Array.isArray(arg)) arg.forEach((item) => {
|
|
2795
|
+
getChildren(item, children);
|
|
2796
|
+
});
|
|
2797
|
+
else if (arg != null && arg !== false) children.push(arg);
|
|
2798
|
+
return children;
|
|
2799
|
+
};
|
|
2800
|
+
const getType = (element) => {
|
|
2801
|
+
const type = element.type;
|
|
2802
|
+
if (typeof type === "string") return type;
|
|
2803
|
+
if (typeof type === "function") return type.displayName || type.name || "Unknown";
|
|
2804
|
+
if (ReactIs.isFragment(element)) return "React.Fragment";
|
|
2805
|
+
if (ReactIs.isSuspense(element)) return "React.Suspense";
|
|
2806
|
+
if (typeof type === "object" && type !== null) {
|
|
2807
|
+
if (ReactIs.isContextProvider(element)) return "Context.Provider";
|
|
2808
|
+
if (ReactIs.isContextConsumer(element)) return "Context.Consumer";
|
|
2809
|
+
if (ReactIs.isForwardRef(element)) {
|
|
2810
|
+
if (type.displayName) return type.displayName;
|
|
2811
|
+
const functionName = type.render.displayName || type.render.name || "";
|
|
2812
|
+
return functionName !== "" ? "ForwardRef(" + functionName + ")" : "ForwardRef";
|
|
2813
|
+
}
|
|
2814
|
+
if (ReactIs.isMemo(element)) {
|
|
2815
|
+
const functionName = type.displayName || type.type.displayName || type.type.name || "";
|
|
2816
|
+
return functionName !== "" ? "Memo(" + functionName + ")" : "Memo";
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
return "UNDEFINED";
|
|
2820
|
+
};
|
|
2821
|
+
const getPropKeys = (element) => {
|
|
2822
|
+
const { props } = element;
|
|
2823
|
+
return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
|
|
2824
|
+
};
|
|
2825
|
+
const serialize = (element, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(getType(element), config) : (0, _markup.printElement)(getType(element), (0, _markup.printProps)(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
|
|
2826
|
+
exports.serialize = serialize;
|
|
2827
|
+
const test = (val) => val != null && ReactIs.isElement(val);
|
|
2828
|
+
exports.test = test;
|
|
2829
|
+
exports.default = {
|
|
2830
|
+
serialize,
|
|
2831
|
+
test
|
|
2832
|
+
};
|
|
2833
|
+
}));
|
|
2834
|
+
//#endregion
|
|
2835
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/ReactTestComponent.js
|
|
2836
|
+
var require_ReactTestComponent = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2837
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2838
|
+
exports.test = exports.serialize = exports.default = void 0;
|
|
2839
|
+
var _markup = require_markup();
|
|
2840
|
+
var global = (function() {
|
|
2841
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
2842
|
+
else if (typeof global !== "undefined") return global;
|
|
2843
|
+
else if (typeof self !== "undefined") return self;
|
|
2844
|
+
else if (typeof window !== "undefined") return window;
|
|
2845
|
+
else return Function("return this")();
|
|
2846
|
+
})();
|
|
2847
|
+
var Symbol = global["jest-symbol-do-not-touch"] || global.Symbol;
|
|
2848
|
+
const testSymbol = typeof Symbol === "function" && Symbol.for ? Symbol.for("react.test.json") : 245830487;
|
|
2849
|
+
const getPropKeys = (object) => {
|
|
2850
|
+
const { props } = object;
|
|
2851
|
+
return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
|
|
2852
|
+
};
|
|
2853
|
+
const serialize = (object, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(object.type, config) : (0, _markup.printElement)(object.type, object.props ? (0, _markup.printProps)(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : "", object.children ? (0, _markup.printChildren)(object.children, config, indentation + config.indent, depth, refs, printer) : "", config, indentation);
|
|
2854
|
+
exports.serialize = serialize;
|
|
2855
|
+
const test = (val) => val && val.$$typeof === testSymbol;
|
|
2856
|
+
exports.test = test;
|
|
2857
|
+
exports.default = {
|
|
2858
|
+
serialize,
|
|
2859
|
+
test
|
|
2860
|
+
};
|
|
2861
|
+
}));
|
|
2862
|
+
//#endregion
|
|
2863
|
+
//#region ../../node_modules/@testing-library/dom/node_modules/pretty-format/build/index.js
|
|
2864
|
+
var require_build = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2865
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2866
|
+
exports.default = exports.DEFAULT_OPTIONS = void 0;
|
|
2867
|
+
exports.format = format;
|
|
2868
|
+
exports.plugins = void 0;
|
|
2869
|
+
var _ansiStyles = _interopRequireDefault(require_ansi_styles());
|
|
2870
|
+
var _collections = require_collections();
|
|
2871
|
+
var _AsymmetricMatcher = _interopRequireDefault(require_AsymmetricMatcher());
|
|
2872
|
+
var _ConvertAnsi = _interopRequireDefault(require_ConvertAnsi());
|
|
2873
|
+
var _DOMCollection = _interopRequireDefault(require_DOMCollection());
|
|
2874
|
+
var _DOMElement = _interopRequireDefault(require_DOMElement());
|
|
2875
|
+
var _Immutable = _interopRequireDefault(require_Immutable());
|
|
2876
|
+
var _ReactElement = _interopRequireDefault(require_ReactElement());
|
|
2877
|
+
var _ReactTestComponent = _interopRequireDefault(require_ReactTestComponent());
|
|
2878
|
+
function _interopRequireDefault(obj) {
|
|
2879
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
2880
|
+
}
|
|
2881
|
+
/**
|
|
2882
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2883
|
+
*
|
|
2884
|
+
* This source code is licensed under the MIT license found in the
|
|
2885
|
+
* LICENSE file in the root directory of this source tree.
|
|
2886
|
+
*/
|
|
2887
|
+
const toString = Object.prototype.toString;
|
|
2888
|
+
const toISOString = Date.prototype.toISOString;
|
|
2889
|
+
const errorToString = Error.prototype.toString;
|
|
2890
|
+
const regExpToString = RegExp.prototype.toString;
|
|
2891
|
+
/**
|
|
2892
|
+
* Explicitly comparing typeof constructor to function avoids undefined as name
|
|
2893
|
+
* when mock identity-obj-proxy returns the key as the value for any key.
|
|
2894
|
+
*/
|
|
2895
|
+
const getConstructorName = (val) => typeof val.constructor === "function" && val.constructor.name || "Object";
|
|
2896
|
+
/** Is val is equal to global window object? Works even if it does not exist :) */
|
|
2897
|
+
const isWindow = (val) => typeof window !== "undefined" && val === window;
|
|
2898
|
+
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
|
|
2899
|
+
const NEWLINE_REGEXP = /\n/gi;
|
|
2900
|
+
var PrettyFormatPluginError = class extends Error {
|
|
2901
|
+
constructor(message, stack) {
|
|
2902
|
+
super(message);
|
|
2903
|
+
this.stack = stack;
|
|
2904
|
+
this.name = this.constructor.name;
|
|
2905
|
+
}
|
|
2906
|
+
};
|
|
2907
|
+
function isToStringedArrayType(toStringed) {
|
|
2908
|
+
return toStringed === "[object Array]" || toStringed === "[object ArrayBuffer]" || toStringed === "[object DataView]" || toStringed === "[object Float32Array]" || toStringed === "[object Float64Array]" || toStringed === "[object Int8Array]" || toStringed === "[object Int16Array]" || toStringed === "[object Int32Array]" || toStringed === "[object Uint8Array]" || toStringed === "[object Uint8ClampedArray]" || toStringed === "[object Uint16Array]" || toStringed === "[object Uint32Array]";
|
|
2909
|
+
}
|
|
2910
|
+
function printNumber(val) {
|
|
2911
|
+
return Object.is(val, -0) ? "-0" : String(val);
|
|
2912
|
+
}
|
|
2913
|
+
function printBigInt(val) {
|
|
2914
|
+
return String(`${val}n`);
|
|
2915
|
+
}
|
|
2916
|
+
function printFunction(val, printFunctionName) {
|
|
2917
|
+
if (!printFunctionName) return "[Function]";
|
|
2918
|
+
return "[Function " + (val.name || "anonymous") + "]";
|
|
2919
|
+
}
|
|
2920
|
+
function printSymbol(val) {
|
|
2921
|
+
return String(val).replace(SYMBOL_REGEXP, "Symbol($1)");
|
|
2922
|
+
}
|
|
2923
|
+
function printError(val) {
|
|
2924
|
+
return "[" + errorToString.call(val) + "]";
|
|
2925
|
+
}
|
|
2926
|
+
/**
|
|
2927
|
+
* The first port of call for printing an object, handles most of the
|
|
2928
|
+
* data-types in JS.
|
|
2929
|
+
*/
|
|
2930
|
+
function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
|
|
2931
|
+
if (val === true || val === false) return "" + val;
|
|
2932
|
+
if (val === void 0) return "undefined";
|
|
2933
|
+
if (val === null) return "null";
|
|
2934
|
+
const typeOf = typeof val;
|
|
2935
|
+
if (typeOf === "number") return printNumber(val);
|
|
2936
|
+
if (typeOf === "bigint") return printBigInt(val);
|
|
2937
|
+
if (typeOf === "string") {
|
|
2938
|
+
if (escapeString) return "\"" + val.replace(/"|\\/g, "\\$&") + "\"";
|
|
2939
|
+
return "\"" + val + "\"";
|
|
2940
|
+
}
|
|
2941
|
+
if (typeOf === "function") return printFunction(val, printFunctionName);
|
|
2942
|
+
if (typeOf === "symbol") return printSymbol(val);
|
|
2943
|
+
const toStringed = toString.call(val);
|
|
2944
|
+
if (toStringed === "[object WeakMap]") return "WeakMap {}";
|
|
2945
|
+
if (toStringed === "[object WeakSet]") return "WeakSet {}";
|
|
2946
|
+
if (toStringed === "[object Function]" || toStringed === "[object GeneratorFunction]") return printFunction(val, printFunctionName);
|
|
2947
|
+
if (toStringed === "[object Symbol]") return printSymbol(val);
|
|
2948
|
+
if (toStringed === "[object Date]") return isNaN(+val) ? "Date { NaN }" : toISOString.call(val);
|
|
2949
|
+
if (toStringed === "[object Error]") return printError(val);
|
|
2950
|
+
if (toStringed === "[object RegExp]") {
|
|
2951
|
+
if (escapeRegex) return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
2952
|
+
return regExpToString.call(val);
|
|
2953
|
+
}
|
|
2954
|
+
if (val instanceof Error) return printError(val);
|
|
2955
|
+
return null;
|
|
2956
|
+
}
|
|
2957
|
+
/**
|
|
2958
|
+
* Handles more complex objects ( such as objects with circular references.
|
|
2959
|
+
* maps and sets etc )
|
|
2960
|
+
*/
|
|
2961
|
+
function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
2962
|
+
if (refs.indexOf(val) !== -1) return "[Circular]";
|
|
2963
|
+
refs = refs.slice();
|
|
2964
|
+
refs.push(val);
|
|
2965
|
+
const hitMaxDepth = ++depth > config.maxDepth;
|
|
2966
|
+
const min = config.min;
|
|
2967
|
+
if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === "function" && !hasCalledToJSON) return printer(val.toJSON(), config, indentation, depth, refs, true);
|
|
2968
|
+
const toStringed = toString.call(val);
|
|
2969
|
+
if (toStringed === "[object Arguments]") return hitMaxDepth ? "[Arguments]" : (min ? "" : "Arguments ") + "[" + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + "]";
|
|
2970
|
+
if (isToStringedArrayType(toStringed)) return hitMaxDepth ? "[" + val.constructor.name + "]" : (min ? "" : !config.printBasicPrototype && val.constructor.name === "Array" ? "" : val.constructor.name + " ") + "[" + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + "]";
|
|
2971
|
+
if (toStringed === "[object Map]") return hitMaxDepth ? "[Map]" : "Map {" + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, " => ") + "}";
|
|
2972
|
+
if (toStringed === "[object Set]") return hitMaxDepth ? "[Set]" : "Set {" + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + "}";
|
|
2973
|
+
return hitMaxDepth || isWindow(val) ? "[" + getConstructorName(val) + "]" : (min ? "" : !config.printBasicPrototype && getConstructorName(val) === "Object" ? "" : getConstructorName(val) + " ") + "{" + (0, _collections.printObjectProperties)(val, config, indentation, depth, refs, printer) + "}";
|
|
2974
|
+
}
|
|
2975
|
+
function isNewPlugin(plugin) {
|
|
2976
|
+
return plugin.serialize != null;
|
|
2977
|
+
}
|
|
2978
|
+
function printPlugin(plugin, val, config, indentation, depth, refs) {
|
|
2979
|
+
let printed;
|
|
2980
|
+
try {
|
|
2981
|
+
printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, (valChild) => printer(valChild, config, indentation, depth, refs), (str) => {
|
|
2982
|
+
const indentationNext = indentation + config.indent;
|
|
2983
|
+
return indentationNext + str.replace(NEWLINE_REGEXP, "\n" + indentationNext);
|
|
2984
|
+
}, {
|
|
2985
|
+
edgeSpacing: config.spacingOuter,
|
|
2986
|
+
min: config.min,
|
|
2987
|
+
spacing: config.spacingInner
|
|
2988
|
+
}, config.colors);
|
|
2989
|
+
} catch (error) {
|
|
2990
|
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
2991
|
+
}
|
|
2992
|
+
if (typeof printed !== "string") throw new Error(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);
|
|
2993
|
+
return printed;
|
|
2994
|
+
}
|
|
2995
|
+
function findPlugin(plugins, val) {
|
|
2996
|
+
for (let p = 0; p < plugins.length; p++) try {
|
|
2997
|
+
if (plugins[p].test(val)) return plugins[p];
|
|
2998
|
+
} catch (error) {
|
|
2999
|
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
3000
|
+
}
|
|
3001
|
+
return null;
|
|
3002
|
+
}
|
|
3003
|
+
function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
3004
|
+
const plugin = findPlugin(config.plugins, val);
|
|
3005
|
+
if (plugin !== null) return printPlugin(plugin, val, config, indentation, depth, refs);
|
|
3006
|
+
const basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
|
|
3007
|
+
if (basicResult !== null) return basicResult;
|
|
3008
|
+
return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
|
|
3009
|
+
}
|
|
3010
|
+
const DEFAULT_THEME = {
|
|
3011
|
+
comment: "gray",
|
|
3012
|
+
content: "reset",
|
|
3013
|
+
prop: "yellow",
|
|
3014
|
+
tag: "cyan",
|
|
3015
|
+
value: "green"
|
|
3016
|
+
};
|
|
3017
|
+
const DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
|
|
3018
|
+
const DEFAULT_OPTIONS = {
|
|
3019
|
+
callToJSON: true,
|
|
3020
|
+
compareKeys: void 0,
|
|
3021
|
+
escapeRegex: false,
|
|
3022
|
+
escapeString: true,
|
|
3023
|
+
highlight: false,
|
|
3024
|
+
indent: 2,
|
|
3025
|
+
maxDepth: Infinity,
|
|
3026
|
+
min: false,
|
|
3027
|
+
plugins: [],
|
|
3028
|
+
printBasicPrototype: true,
|
|
3029
|
+
printFunctionName: true,
|
|
3030
|
+
theme: DEFAULT_THEME
|
|
3031
|
+
};
|
|
3032
|
+
exports.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
|
|
3033
|
+
function validateOptions(options) {
|
|
3034
|
+
Object.keys(options).forEach((key) => {
|
|
3035
|
+
if (!DEFAULT_OPTIONS.hasOwnProperty(key)) throw new Error(`pretty-format: Unknown option "${key}".`);
|
|
3036
|
+
});
|
|
3037
|
+
if (options.min && options.indent !== void 0 && options.indent !== 0) throw new Error("pretty-format: Options \"min\" and \"indent\" cannot be used together.");
|
|
3038
|
+
if (options.theme !== void 0) {
|
|
3039
|
+
if (options.theme === null) throw new Error("pretty-format: Option \"theme\" must not be null.");
|
|
3040
|
+
if (typeof options.theme !== "object") throw new Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`);
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
const getColorsHighlight = (options) => DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
3044
|
+
const value = options.theme && options.theme[key] !== void 0 ? options.theme[key] : DEFAULT_THEME[key];
|
|
3045
|
+
const color = value && _ansiStyles.default[value];
|
|
3046
|
+
if (color && typeof color.close === "string" && typeof color.open === "string") colors[key] = color;
|
|
3047
|
+
else throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
|
|
3048
|
+
return colors;
|
|
3049
|
+
}, Object.create(null));
|
|
3050
|
+
const getColorsEmpty = () => DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
3051
|
+
colors[key] = {
|
|
3052
|
+
close: "",
|
|
3053
|
+
open: ""
|
|
3054
|
+
};
|
|
3055
|
+
return colors;
|
|
3056
|
+
}, Object.create(null));
|
|
3057
|
+
const getPrintFunctionName = (options) => options && options.printFunctionName !== void 0 ? options.printFunctionName : DEFAULT_OPTIONS.printFunctionName;
|
|
3058
|
+
const getEscapeRegex = (options) => options && options.escapeRegex !== void 0 ? options.escapeRegex : DEFAULT_OPTIONS.escapeRegex;
|
|
3059
|
+
const getEscapeString = (options) => options && options.escapeString !== void 0 ? options.escapeString : DEFAULT_OPTIONS.escapeString;
|
|
3060
|
+
const getConfig = (options) => {
|
|
3061
|
+
var _options$printBasicPr;
|
|
3062
|
+
return {
|
|
3063
|
+
callToJSON: options && options.callToJSON !== void 0 ? options.callToJSON : DEFAULT_OPTIONS.callToJSON,
|
|
3064
|
+
colors: options && options.highlight ? getColorsHighlight(options) : getColorsEmpty(),
|
|
3065
|
+
compareKeys: options && typeof options.compareKeys === "function" ? options.compareKeys : DEFAULT_OPTIONS.compareKeys,
|
|
3066
|
+
escapeRegex: getEscapeRegex(options),
|
|
3067
|
+
escapeString: getEscapeString(options),
|
|
3068
|
+
indent: options && options.min ? "" : createIndent(options && options.indent !== void 0 ? options.indent : DEFAULT_OPTIONS.indent),
|
|
3069
|
+
maxDepth: options && options.maxDepth !== void 0 ? options.maxDepth : DEFAULT_OPTIONS.maxDepth,
|
|
3070
|
+
min: options && options.min !== void 0 ? options.min : DEFAULT_OPTIONS.min,
|
|
3071
|
+
plugins: options && options.plugins !== void 0 ? options.plugins : DEFAULT_OPTIONS.plugins,
|
|
3072
|
+
printBasicPrototype: (_options$printBasicPr = options === null || options === void 0 ? void 0 : options.printBasicPrototype) !== null && _options$printBasicPr !== void 0 ? _options$printBasicPr : true,
|
|
3073
|
+
printFunctionName: getPrintFunctionName(options),
|
|
3074
|
+
spacingInner: options && options.min ? " " : "\n",
|
|
3075
|
+
spacingOuter: options && options.min ? "" : "\n"
|
|
3076
|
+
};
|
|
3077
|
+
};
|
|
3078
|
+
function createIndent(indent) {
|
|
3079
|
+
return new Array(indent + 1).join(" ");
|
|
3080
|
+
}
|
|
3081
|
+
/**
|
|
3082
|
+
* Returns a presentation string of your `val` object
|
|
3083
|
+
* @param val any potential JavaScript object
|
|
3084
|
+
* @param options Custom settings
|
|
3085
|
+
*/
|
|
3086
|
+
function format(val, options) {
|
|
3087
|
+
if (options) {
|
|
3088
|
+
validateOptions(options);
|
|
3089
|
+
if (options.plugins) {
|
|
3090
|
+
const plugin = findPlugin(options.plugins, val);
|
|
3091
|
+
if (plugin !== null) return printPlugin(plugin, val, getConfig(options), "", 0, []);
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
const basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
|
|
3095
|
+
if (basicResult !== null) return basicResult;
|
|
3096
|
+
return printComplexValue(val, getConfig(options), "", 0, []);
|
|
3097
|
+
}
|
|
3098
|
+
exports.plugins = {
|
|
3099
|
+
AsymmetricMatcher: _AsymmetricMatcher.default,
|
|
3100
|
+
ConvertAnsi: _ConvertAnsi.default,
|
|
3101
|
+
DOMCollection: _DOMCollection.default,
|
|
3102
|
+
DOMElement: _DOMElement.default,
|
|
3103
|
+
Immutable: _Immutable.default,
|
|
3104
|
+
ReactElement: _ReactElement.default,
|
|
3105
|
+
ReactTestComponent: _ReactTestComponent.default
|
|
3106
|
+
};
|
|
3107
|
+
exports.default = format;
|
|
3108
|
+
}));
|
|
3109
|
+
//#endregion
|
|
3110
|
+
//#region ../../node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js
|
|
3111
|
+
var dom_esm_exports = /* @__PURE__ */ __exportAll({
|
|
3112
|
+
buildQueries: () => buildQueries,
|
|
3113
|
+
configure: () => configure,
|
|
3114
|
+
createEvent: () => createEvent$1,
|
|
3115
|
+
findAllByAltText: () => findAllByAltText,
|
|
3116
|
+
findAllByDisplayValue: () => findAllByDisplayValue,
|
|
3117
|
+
findAllByLabelText: () => findAllByLabelText,
|
|
3118
|
+
findAllByPlaceholderText: () => findAllByPlaceholderText,
|
|
3119
|
+
findAllByRole: () => findAllByRole,
|
|
3120
|
+
findAllByTestId: () => findAllByTestId,
|
|
3121
|
+
findAllByText: () => findAllByText,
|
|
3122
|
+
findAllByTitle: () => findAllByTitle,
|
|
3123
|
+
findByAltText: () => findByAltText,
|
|
3124
|
+
findByDisplayValue: () => findByDisplayValue,
|
|
3125
|
+
findByLabelText: () => findByLabelText,
|
|
3126
|
+
findByPlaceholderText: () => findByPlaceholderText,
|
|
3127
|
+
findByRole: () => findByRole,
|
|
3128
|
+
findByTestId: () => findByTestId,
|
|
3129
|
+
findByText: () => findByText,
|
|
3130
|
+
findByTitle: () => findByTitle,
|
|
3131
|
+
fireEvent: () => fireEvent,
|
|
3132
|
+
getAllByAltText: () => getAllByAltText,
|
|
3133
|
+
getAllByDisplayValue: () => getAllByDisplayValue,
|
|
3134
|
+
getAllByLabelText: () => getAllByLabelTextWithSuggestions,
|
|
3135
|
+
getAllByPlaceholderText: () => getAllByPlaceholderText,
|
|
3136
|
+
getAllByRole: () => getAllByRole,
|
|
3137
|
+
getAllByTestId: () => getAllByTestId,
|
|
3138
|
+
getAllByText: () => getAllByText,
|
|
3139
|
+
getAllByTitle: () => getAllByTitle,
|
|
3140
|
+
getByAltText: () => getByAltText,
|
|
3141
|
+
getByDisplayValue: () => getByDisplayValue,
|
|
3142
|
+
getByLabelText: () => getByLabelTextWithSuggestions,
|
|
3143
|
+
getByPlaceholderText: () => getByPlaceholderText,
|
|
3144
|
+
getByRole: () => getByRole,
|
|
3145
|
+
getByTestId: () => getByTestId,
|
|
3146
|
+
getByText: () => getByText,
|
|
3147
|
+
getByTitle: () => getByTitle,
|
|
3148
|
+
getConfig: () => getConfig,
|
|
3149
|
+
getDefaultNormalizer: () => getDefaultNormalizer,
|
|
3150
|
+
getElementError: () => getElementError,
|
|
3151
|
+
getMultipleElementsFoundError: () => getMultipleElementsFoundError,
|
|
3152
|
+
getNodeText: () => getNodeText,
|
|
3153
|
+
getQueriesForElement: () => getQueriesForElement,
|
|
3154
|
+
getRoles: () => getRoles,
|
|
3155
|
+
getSuggestedQuery: () => getSuggestedQuery,
|
|
3156
|
+
isInaccessible: () => isInaccessible,
|
|
3157
|
+
logDOM: () => logDOM,
|
|
3158
|
+
logRoles: () => logRoles,
|
|
3159
|
+
makeFindQuery: () => makeFindQuery,
|
|
3160
|
+
makeGetAllQuery: () => makeGetAllQuery,
|
|
3161
|
+
makeSingleQuery: () => makeSingleQuery,
|
|
3162
|
+
prettyDOM: () => prettyDOM,
|
|
3163
|
+
prettyFormat: () => import_build,
|
|
3164
|
+
queries: () => queries,
|
|
3165
|
+
queryAllByAltText: () => queryAllByAltTextWithSuggestions,
|
|
3166
|
+
queryAllByAttribute: () => queryAllByAttribute,
|
|
3167
|
+
queryAllByDisplayValue: () => queryAllByDisplayValueWithSuggestions,
|
|
3168
|
+
queryAllByLabelText: () => queryAllByLabelTextWithSuggestions,
|
|
3169
|
+
queryAllByPlaceholderText: () => queryAllByPlaceholderTextWithSuggestions,
|
|
3170
|
+
queryAllByRole: () => queryAllByRoleWithSuggestions,
|
|
3171
|
+
queryAllByTestId: () => queryAllByTestIdWithSuggestions,
|
|
3172
|
+
queryAllByText: () => queryAllByTextWithSuggestions,
|
|
3173
|
+
queryAllByTitle: () => queryAllByTitleWithSuggestions,
|
|
3174
|
+
queryByAltText: () => queryByAltText,
|
|
3175
|
+
queryByAttribute: () => queryByAttribute,
|
|
3176
|
+
queryByDisplayValue: () => queryByDisplayValue,
|
|
3177
|
+
queryByLabelText: () => queryByLabelText,
|
|
3178
|
+
queryByPlaceholderText: () => queryByPlaceholderText,
|
|
3179
|
+
queryByRole: () => queryByRole,
|
|
3180
|
+
queryByTestId: () => queryByTestId,
|
|
3181
|
+
queryByText: () => queryByText,
|
|
3182
|
+
queryByTitle: () => queryByTitle,
|
|
3183
|
+
queryHelpers: () => queryHelpers,
|
|
3184
|
+
screen: () => screen,
|
|
3185
|
+
waitFor: () => waitForWrapper,
|
|
3186
|
+
waitForElementToBeRemoved: () => waitForElementToBeRemoved,
|
|
3187
|
+
within: () => getQueriesForElement,
|
|
3188
|
+
wrapAllByQueryWithSuggestion: () => wrapAllByQueryWithSuggestion,
|
|
3189
|
+
wrapSingleQueryWithSuggestion: () => wrapSingleQueryWithSuggestion
|
|
3190
|
+
});
|
|
3191
|
+
/**
|
|
3192
|
+
* Source: https://github.com/facebook/jest/blob/e7bb6a1e26ffab90611b2593912df15b69315611/packages/pretty-format/src/plugins/DOMElement.ts
|
|
3193
|
+
*/
|
|
3194
|
+
/* istanbul ignore file */
|
|
3195
|
+
function escapeHTML(str) {
|
|
3196
|
+
return str.replace(/</g, "<").replace(/>/g, ">");
|
|
3197
|
+
}
|
|
3198
|
+
function nodeIsText(node) {
|
|
3199
|
+
return node.nodeType === TEXT_NODE$1;
|
|
3200
|
+
}
|
|
3201
|
+
function nodeIsComment(node) {
|
|
3202
|
+
return node.nodeType === COMMENT_NODE$1;
|
|
3203
|
+
}
|
|
3204
|
+
function nodeIsFragment(node) {
|
|
3205
|
+
return node.nodeType === FRAGMENT_NODE;
|
|
3206
|
+
}
|
|
3207
|
+
function createDOMElementFilter(filterNode) {
|
|
3208
|
+
return {
|
|
3209
|
+
test: (val) => {
|
|
3210
|
+
var _val$constructor2;
|
|
3211
|
+
return ((val == null || (_val$constructor2 = val.constructor) == null ? void 0 : _val$constructor2.name) || isCustomElement(val)) && testNode(val);
|
|
3212
|
+
},
|
|
3213
|
+
serialize: (node, config, indentation, depth, refs, printer) => {
|
|
3214
|
+
if (nodeIsText(node)) return printText(node.data, config);
|
|
3215
|
+
if (nodeIsComment(node)) return printComment(node.data, config);
|
|
3216
|
+
const type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
|
|
3217
|
+
if (++depth > config.maxDepth) return printElementAsLeaf(type, config);
|
|
3218
|
+
return printElement(type, printProps(nodeIsFragment(node) ? [] : Array.from(node.attributes).map((attr) => attr.name).sort(), nodeIsFragment(node) ? {} : Array.from(node.attributes).reduce((props, attribute) => {
|
|
3219
|
+
props[attribute.name] = attribute.value;
|
|
3220
|
+
return props;
|
|
3221
|
+
}, {}), config, indentation + config.indent, depth, refs, printer), printChildren(Array.prototype.slice.call(node.childNodes || node.children).filter(filterNode), config, indentation + config.indent, depth, refs, printer), config, indentation);
|
|
3222
|
+
}
|
|
3223
|
+
};
|
|
3224
|
+
}
|
|
3225
|
+
function getCodeFrame(frame) {
|
|
3226
|
+
const locationStart = frame.indexOf("(") + 1;
|
|
3227
|
+
const locationEnd = frame.indexOf(")");
|
|
3228
|
+
const frameLocation = frame.slice(locationStart, locationEnd);
|
|
3229
|
+
const frameLocationElements = frameLocation.split(":");
|
|
3230
|
+
const _ref = [
|
|
3231
|
+
frameLocationElements[0],
|
|
3232
|
+
parseInt(frameLocationElements[1], 10),
|
|
3233
|
+
parseInt(frameLocationElements[2], 10)
|
|
3234
|
+
], filename = _ref[0], line = _ref[1], column = _ref[2];
|
|
3235
|
+
let rawFileContents = "";
|
|
3236
|
+
try {
|
|
3237
|
+
rawFileContents = readFileSync(filename, "utf-8");
|
|
3238
|
+
} catch {
|
|
3239
|
+
return "";
|
|
3240
|
+
}
|
|
3241
|
+
const codeFrame = codeFrameColumns(rawFileContents, { start: {
|
|
3242
|
+
line,
|
|
3243
|
+
column
|
|
3244
|
+
} }, {
|
|
3245
|
+
highlightCode: true,
|
|
3246
|
+
linesBelow: 0
|
|
3247
|
+
});
|
|
3248
|
+
return picocolors.dim(frameLocation) + "\n" + codeFrame + "\n";
|
|
3249
|
+
}
|
|
3250
|
+
function getUserCodeFrame() {
|
|
3251
|
+
/* istanbul ignore next */
|
|
3252
|
+
if (!readFileSync || !codeFrameColumns) return "";
|
|
3253
|
+
return getCodeFrame((/* @__PURE__ */ new Error()).stack.split("\n").slice(1).find((frame) => !frame.includes("node_modules/")));
|
|
3254
|
+
}
|
|
3255
|
+
function jestFakeTimersAreEnabled() {
|
|
3256
|
+
/* istanbul ignore else */
|
|
3257
|
+
if (typeof jest !== "undefined" && jest !== null) return setTimeout._isMockFunction === true || Object.prototype.hasOwnProperty.call(setTimeout, "clock");
|
|
3258
|
+
// istanbul ignore next
|
|
3259
|
+
return false;
|
|
3260
|
+
}
|
|
3261
|
+
function getDocument$1() {
|
|
3262
|
+
/* istanbul ignore if */
|
|
3263
|
+
if (typeof window === "undefined") throw new Error("Could not find default container");
|
|
3264
|
+
return window.document;
|
|
3265
|
+
}
|
|
3266
|
+
function getWindowFromNode(node) {
|
|
3267
|
+
if (node.defaultView) return node.defaultView;
|
|
3268
|
+
else if (node.ownerDocument && node.ownerDocument.defaultView) return node.ownerDocument.defaultView;
|
|
3269
|
+
else if (node.window) return node.window;
|
|
3270
|
+
else if (node.ownerDocument && node.ownerDocument.defaultView === null) throw new Error("It looks like the window object is not available for the provided node.");
|
|
3271
|
+
else if (node.then instanceof Function) throw new Error("It looks like you passed a Promise object instead of a DOM node. Did you do something like `fireEvent.click(screen.findBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`, or await the findBy query `fireEvent.click(await screen.findBy...`?");
|
|
3272
|
+
else if (Array.isArray(node)) throw new Error("It looks like you passed an Array instead of a DOM node. Did you do something like `fireEvent.click(screen.getAllBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`?");
|
|
3273
|
+
else if (typeof node.debug === "function" && typeof node.logTestingPlaygroundURL === "function") throw new Error("It looks like you passed a `screen` object. Did you do something like `fireEvent.click(screen, ...` when you meant to use a query, e.g. `fireEvent.click(screen.getBy..., `?");
|
|
3274
|
+
else throw new Error("The given node is not an Element, the node type is: " + typeof node + ".");
|
|
3275
|
+
}
|
|
3276
|
+
function checkContainerType(container) {
|
|
3277
|
+
if (!container || !(typeof container.querySelector === "function") || !(typeof container.querySelectorAll === "function")) throw new TypeError("Expected container to be an Element, a Document or a DocumentFragment but got " + getTypeName(container) + ".");
|
|
3278
|
+
function getTypeName(object) {
|
|
3279
|
+
if (typeof object === "object") return object === null ? "null" : object.constructor.name;
|
|
3280
|
+
return typeof object;
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
function filterCommentsAndDefaultIgnoreTagsTags(value) {
|
|
3284
|
+
return value.nodeType !== COMMENT_NODE && (value.nodeType !== ELEMENT_NODE || !value.matches(getConfig().defaultIgnore));
|
|
3285
|
+
}
|
|
3286
|
+
function prettyDOM(dom, maxLength, options) {
|
|
3287
|
+
if (options === void 0) options = {};
|
|
3288
|
+
if (!dom) dom = getDocument$1().body;
|
|
3289
|
+
if (typeof maxLength !== "number") maxLength = typeof process !== "undefined" && typeof process.env !== "undefined" && process.env.DEBUG_PRINT_LIMIT || 7e3;
|
|
3290
|
+
if (maxLength === 0) return "";
|
|
3291
|
+
if (dom.documentElement) dom = dom.documentElement;
|
|
3292
|
+
let domTypeName = typeof dom;
|
|
3293
|
+
if (domTypeName === "object") domTypeName = dom.constructor.name;
|
|
3294
|
+
else dom = {};
|
|
3295
|
+
if (!("outerHTML" in dom)) throw new TypeError("Expected an element or document but got " + domTypeName);
|
|
3296
|
+
const _options = options, _options$filterNode = _options.filterNode, filterNode = _options$filterNode === void 0 ? filterCommentsAndDefaultIgnoreTagsTags : _options$filterNode, prettyFormatOptions = _objectWithoutPropertiesLoose(_options, _excluded$1);
|
|
3297
|
+
const debugContent = import_build.format(dom, {
|
|
3298
|
+
plugins: [createDOMElementFilter(filterNode), DOMCollection],
|
|
3299
|
+
printFunctionName: false,
|
|
3300
|
+
highlight: shouldHighlight(),
|
|
3301
|
+
...prettyFormatOptions
|
|
3302
|
+
});
|
|
3303
|
+
return maxLength !== void 0 && dom.outerHTML.length > maxLength ? debugContent.slice(0, maxLength) + "..." : debugContent;
|
|
3304
|
+
}
|
|
3305
|
+
function runWithExpensiveErrorDiagnosticsDisabled(callback) {
|
|
3306
|
+
try {
|
|
3307
|
+
config._disableExpensiveErrorDiagnostics = true;
|
|
3308
|
+
return callback();
|
|
3309
|
+
} finally {
|
|
3310
|
+
config._disableExpensiveErrorDiagnostics = false;
|
|
3311
|
+
}
|
|
3312
|
+
}
|
|
3313
|
+
function configure(newConfig) {
|
|
3314
|
+
if (typeof newConfig === "function") newConfig = newConfig(config);
|
|
3315
|
+
config = {
|
|
3316
|
+
...config,
|
|
3317
|
+
...newConfig
|
|
3318
|
+
};
|
|
3319
|
+
}
|
|
3320
|
+
function getConfig() {
|
|
3321
|
+
return config;
|
|
3322
|
+
}
|
|
3323
|
+
function getTextContent(node) {
|
|
3324
|
+
if (labelledNodeNames.includes(node.nodeName.toLowerCase())) return "";
|
|
3325
|
+
if (node.nodeType === TEXT_NODE) return node.textContent;
|
|
3326
|
+
return Array.from(node.childNodes).map((childNode) => getTextContent(childNode)).join("");
|
|
3327
|
+
}
|
|
3328
|
+
function getLabelContent(element) {
|
|
3329
|
+
let textContent;
|
|
3330
|
+
if (element.tagName.toLowerCase() === "label") textContent = getTextContent(element);
|
|
3331
|
+
else textContent = element.value || element.textContent;
|
|
3332
|
+
return textContent;
|
|
3333
|
+
}
|
|
3334
|
+
function getRealLabels(element) {
|
|
3335
|
+
if (element.labels !== void 0) {
|
|
3336
|
+
var _labels;
|
|
3337
|
+
return (_labels = element.labels) != null ? _labels : [];
|
|
3338
|
+
}
|
|
3339
|
+
if (!isLabelable(element)) return [];
|
|
3340
|
+
const labels = element.ownerDocument.querySelectorAll("label");
|
|
3341
|
+
return Array.from(labels).filter((label) => label.control === element);
|
|
3342
|
+
}
|
|
3343
|
+
function isLabelable(element) {
|
|
3344
|
+
return /BUTTON|METER|OUTPUT|PROGRESS|SELECT|TEXTAREA/.test(element.tagName) || element.tagName === "INPUT" && element.getAttribute("type") !== "hidden";
|
|
3345
|
+
}
|
|
3346
|
+
function getLabels(container, element, _temp) {
|
|
3347
|
+
let _ref$selector = (_temp === void 0 ? {} : _temp).selector, selector = _ref$selector === void 0 ? "*" : _ref$selector;
|
|
3348
|
+
const ariaLabelledBy = element.getAttribute("aria-labelledby");
|
|
3349
|
+
const labelsId = ariaLabelledBy ? ariaLabelledBy.split(" ") : [];
|
|
3350
|
+
return labelsId.length ? labelsId.map((labelId) => {
|
|
3351
|
+
const labellingElement = container.querySelector("[id=\"" + labelId + "\"]");
|
|
3352
|
+
return labellingElement ? {
|
|
3353
|
+
content: getLabelContent(labellingElement),
|
|
3354
|
+
formControl: null
|
|
3355
|
+
} : {
|
|
3356
|
+
content: "",
|
|
3357
|
+
formControl: null
|
|
3358
|
+
};
|
|
3359
|
+
}) : Array.from(getRealLabels(element)).map((label) => {
|
|
3360
|
+
return {
|
|
3361
|
+
content: getLabelContent(label),
|
|
3362
|
+
formControl: Array.from(label.querySelectorAll("button, input, meter, output, progress, select, textarea")).filter((formControlElement) => formControlElement.matches(selector))[0]
|
|
3363
|
+
};
|
|
3364
|
+
});
|
|
3365
|
+
}
|
|
3366
|
+
function assertNotNullOrUndefined(matcher) {
|
|
3367
|
+
if (matcher === null || matcher === void 0) throw new Error("It looks like " + matcher + " was passed instead of a matcher. Did you do something like getByText(" + matcher + ")?");
|
|
3368
|
+
}
|
|
3369
|
+
function fuzzyMatches(textToMatch, node, matcher, normalizer) {
|
|
3370
|
+
if (typeof textToMatch !== "string") return false;
|
|
3371
|
+
assertNotNullOrUndefined(matcher);
|
|
3372
|
+
const normalizedText = normalizer(textToMatch);
|
|
3373
|
+
if (typeof matcher === "string" || typeof matcher === "number") return normalizedText.toLowerCase().includes(matcher.toString().toLowerCase());
|
|
3374
|
+
else if (typeof matcher === "function") return matcher(normalizedText, node);
|
|
3375
|
+
else return matchRegExp(matcher, normalizedText);
|
|
3376
|
+
}
|
|
3377
|
+
function matches(textToMatch, node, matcher, normalizer) {
|
|
3378
|
+
if (typeof textToMatch !== "string") return false;
|
|
3379
|
+
assertNotNullOrUndefined(matcher);
|
|
3380
|
+
const normalizedText = normalizer(textToMatch);
|
|
3381
|
+
if (matcher instanceof Function) return matcher(normalizedText, node);
|
|
3382
|
+
else if (matcher instanceof RegExp) return matchRegExp(matcher, normalizedText);
|
|
3383
|
+
else return normalizedText === String(matcher);
|
|
3384
|
+
}
|
|
3385
|
+
function getDefaultNormalizer(_temp) {
|
|
3386
|
+
let _ref = _temp === void 0 ? {} : _temp, _ref$trim = _ref.trim, trim = _ref$trim === void 0 ? true : _ref$trim, _ref$collapseWhitespa = _ref.collapseWhitespace, collapseWhitespace = _ref$collapseWhitespa === void 0 ? true : _ref$collapseWhitespa;
|
|
3387
|
+
return (text) => {
|
|
3388
|
+
let normalizedText = text;
|
|
3389
|
+
normalizedText = trim ? normalizedText.trim() : normalizedText;
|
|
3390
|
+
normalizedText = collapseWhitespace ? normalizedText.replace(/\s+/g, " ") : normalizedText;
|
|
3391
|
+
return normalizedText;
|
|
3392
|
+
};
|
|
3393
|
+
}
|
|
3394
|
+
/**
|
|
3395
|
+
* Constructs a normalizer to pass to functions in matches.js
|
|
3396
|
+
* @param {boolean|undefined} trim The user-specified value for `trim`, without
|
|
3397
|
+
* any defaulting having been applied
|
|
3398
|
+
* @param {boolean|undefined} collapseWhitespace The user-specified value for
|
|
3399
|
+
* `collapseWhitespace`, without any defaulting having been applied
|
|
3400
|
+
* @param {Function|undefined} normalizer The user-specified normalizer
|
|
3401
|
+
* @returns {Function} A normalizer
|
|
3402
|
+
*/
|
|
3403
|
+
function makeNormalizer(_ref2) {
|
|
3404
|
+
let trim = _ref2.trim, collapseWhitespace = _ref2.collapseWhitespace, normalizer = _ref2.normalizer;
|
|
3405
|
+
if (!normalizer) return getDefaultNormalizer({
|
|
3406
|
+
trim,
|
|
3407
|
+
collapseWhitespace
|
|
3408
|
+
});
|
|
3409
|
+
if (typeof trim !== "undefined" || typeof collapseWhitespace !== "undefined") throw new Error("trim and collapseWhitespace are not supported with a normalizer. If you want to use the default trim and collapseWhitespace logic in your normalizer, use \"getDefaultNormalizer({trim, collapseWhitespace})\" and compose that into your normalizer");
|
|
3410
|
+
return normalizer;
|
|
3411
|
+
}
|
|
3412
|
+
function matchRegExp(matcher, text) {
|
|
3413
|
+
const match = matcher.test(text);
|
|
3414
|
+
if (matcher.global && matcher.lastIndex !== 0) {
|
|
3415
|
+
console.warn("To match all elements we had to reset the lastIndex of the RegExp because the global flag is enabled. We encourage to remove the global flag from the RegExp.");
|
|
3416
|
+
matcher.lastIndex = 0;
|
|
3417
|
+
}
|
|
3418
|
+
return match;
|
|
3419
|
+
}
|
|
3420
|
+
function getNodeText(node) {
|
|
3421
|
+
if (node.matches("input[type=submit], input[type=button], input[type=reset]")) return node.value;
|
|
3422
|
+
return Array.from(node.childNodes).filter((child) => child.nodeType === TEXT_NODE && Boolean(child.textContent)).map((c) => c.textContent).join("");
|
|
3423
|
+
}
|
|
3424
|
+
/**
|
|
3425
|
+
* @param {Element} element -
|
|
3426
|
+
* @returns {boolean} - `true` if `element` and its subtree are inaccessible
|
|
3427
|
+
*/
|
|
3428
|
+
function isSubtreeInaccessible(element) {
|
|
3429
|
+
if (element.hidden === true) return true;
|
|
3430
|
+
if (element.getAttribute("aria-hidden") === "true") return true;
|
|
3431
|
+
if (element.ownerDocument.defaultView.getComputedStyle(element).display === "none") return true;
|
|
3432
|
+
return false;
|
|
3433
|
+
}
|
|
3434
|
+
/**
|
|
3435
|
+
* Partial implementation https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion
|
|
3436
|
+
* which should only be used for elements with a non-presentational role i.e.
|
|
3437
|
+
* `role="none"` and `role="presentation"` will not be excluded.
|
|
3438
|
+
*
|
|
3439
|
+
* Implements aria-hidden semantics (i.e. parent overrides child)
|
|
3440
|
+
* Ignores "Child Presentational: True" characteristics
|
|
3441
|
+
*
|
|
3442
|
+
* @param {Element} element -
|
|
3443
|
+
* @param {object} [options] -
|
|
3444
|
+
* @param {function (element: Element): boolean} options.isSubtreeInaccessible -
|
|
3445
|
+
* can be used to return cached results from previous isSubtreeInaccessible calls
|
|
3446
|
+
* @returns {boolean} true if excluded, otherwise false
|
|
3447
|
+
*/
|
|
3448
|
+
function isInaccessible(element, options) {
|
|
3449
|
+
if (options === void 0) options = {};
|
|
3450
|
+
const _options$isSubtreeIna = options.isSubtreeInaccessible, isSubtreeInaccessibleImpl = _options$isSubtreeIna === void 0 ? isSubtreeInaccessible : _options$isSubtreeIna;
|
|
3451
|
+
if (element.ownerDocument.defaultView.getComputedStyle(element).visibility === "hidden") return true;
|
|
3452
|
+
let currentElement = element;
|
|
3453
|
+
while (currentElement) {
|
|
3454
|
+
if (isSubtreeInaccessibleImpl(currentElement)) return true;
|
|
3455
|
+
currentElement = currentElement.parentElement;
|
|
3456
|
+
}
|
|
3457
|
+
return false;
|
|
3458
|
+
}
|
|
3459
|
+
function getImplicitAriaRoles(currentNode) {
|
|
3460
|
+
for (const _ref of elementRoleList) {
|
|
3461
|
+
const match = _ref.match;
|
|
3462
|
+
const roles = _ref.roles;
|
|
3463
|
+
if (match(currentNode)) return [...roles];
|
|
3464
|
+
}
|
|
3465
|
+
return [];
|
|
3466
|
+
}
|
|
3467
|
+
function buildElementRoleList(elementRolesMap) {
|
|
3468
|
+
function makeElementSelector(_ref2) {
|
|
3469
|
+
let name = _ref2.name, attributes = _ref2.attributes;
|
|
3470
|
+
return "" + name + attributes.map((_ref3) => {
|
|
3471
|
+
let attributeName = _ref3.name, value = _ref3.value, _ref3$constraints = _ref3.constraints, constraints = _ref3$constraints === void 0 ? [] : _ref3$constraints;
|
|
3472
|
+
const shouldNotExist = constraints.indexOf("undefined") !== -1;
|
|
3473
|
+
const shouldBeNonEmpty = constraints.indexOf("set") !== -1;
|
|
3474
|
+
if (typeof value !== "undefined") return "[" + attributeName + "=\"" + value + "\"]";
|
|
3475
|
+
else if (shouldNotExist) return ":not([" + attributeName + "])";
|
|
3476
|
+
else if (shouldBeNonEmpty) return "[" + attributeName + "]:not([" + attributeName + "=\"\"])";
|
|
3477
|
+
return "[" + attributeName + "]";
|
|
3478
|
+
}).join("");
|
|
3479
|
+
}
|
|
3480
|
+
function getSelectorSpecificity(_ref4) {
|
|
3481
|
+
let _ref4$attributes = _ref4.attributes;
|
|
3482
|
+
return (_ref4$attributes === void 0 ? [] : _ref4$attributes).length;
|
|
3483
|
+
}
|
|
3484
|
+
function bySelectorSpecificity(_ref5, _ref6) {
|
|
3485
|
+
let leftSpecificity = _ref5.specificity;
|
|
3486
|
+
return _ref6.specificity - leftSpecificity;
|
|
3487
|
+
}
|
|
3488
|
+
function match(element) {
|
|
3489
|
+
let _element$attributes = element.attributes, attributes = _element$attributes === void 0 ? [] : _element$attributes;
|
|
3490
|
+
const typeTextIndex = attributes.findIndex((attribute) => attribute.value && attribute.name === "type" && attribute.value === "text");
|
|
3491
|
+
if (typeTextIndex >= 0) attributes = [...attributes.slice(0, typeTextIndex), ...attributes.slice(typeTextIndex + 1)];
|
|
3492
|
+
const selector = makeElementSelector({
|
|
3493
|
+
...element,
|
|
3494
|
+
attributes
|
|
3495
|
+
});
|
|
3496
|
+
return (node) => {
|
|
3497
|
+
if (typeTextIndex >= 0 && node.type !== "text") return false;
|
|
3498
|
+
return node.matches(selector);
|
|
3499
|
+
};
|
|
3500
|
+
}
|
|
3501
|
+
let result = [];
|
|
3502
|
+
for (const _ref7 of elementRolesMap.entries()) {
|
|
3503
|
+
const element = _ref7[0];
|
|
3504
|
+
const roles = _ref7[1];
|
|
3505
|
+
result = [...result, {
|
|
3506
|
+
match: match(element),
|
|
3507
|
+
roles: Array.from(roles),
|
|
3508
|
+
specificity: getSelectorSpecificity(element)
|
|
3509
|
+
}];
|
|
3510
|
+
}
|
|
3511
|
+
return result.sort(bySelectorSpecificity);
|
|
3512
|
+
}
|
|
3513
|
+
function getRoles(container, _temp) {
|
|
3514
|
+
let _ref8$hidden = (_temp === void 0 ? {} : _temp).hidden, hidden = _ref8$hidden === void 0 ? false : _ref8$hidden;
|
|
3515
|
+
function flattenDOM(node) {
|
|
3516
|
+
return [node, ...Array.from(node.children).reduce((acc, child) => [...acc, ...flattenDOM(child)], [])];
|
|
3517
|
+
}
|
|
3518
|
+
return flattenDOM(container).filter((element) => {
|
|
3519
|
+
return hidden === false ? isInaccessible(element) === false : true;
|
|
3520
|
+
}).reduce((acc, node) => {
|
|
3521
|
+
let roles = [];
|
|
3522
|
+
if (node.hasAttribute("role")) roles = node.getAttribute("role").split(" ").slice(0, 1);
|
|
3523
|
+
else roles = getImplicitAriaRoles(node);
|
|
3524
|
+
return roles.reduce((rolesAcc, role) => Array.isArray(rolesAcc[role]) ? {
|
|
3525
|
+
...rolesAcc,
|
|
3526
|
+
[role]: [...rolesAcc[role], node]
|
|
3527
|
+
} : {
|
|
3528
|
+
...rolesAcc,
|
|
3529
|
+
[role]: [node]
|
|
3530
|
+
}, acc);
|
|
3531
|
+
}, {});
|
|
3532
|
+
}
|
|
3533
|
+
function prettyRoles(dom, _ref9) {
|
|
3534
|
+
let hidden = _ref9.hidden, includeDescription = _ref9.includeDescription;
|
|
3535
|
+
const roles = getRoles(dom, { hidden });
|
|
3536
|
+
return Object.entries(roles).filter((_ref0) => {
|
|
3537
|
+
return _ref0[0] !== "generic";
|
|
3538
|
+
}).map((_ref1) => {
|
|
3539
|
+
let role = _ref1[0], elements = _ref1[1];
|
|
3540
|
+
const delimiterBar = "-".repeat(50);
|
|
3541
|
+
const elementsString = elements.map((el) => {
|
|
3542
|
+
const nameString = "Name \"" + computeAccessibleName$1(el, { computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements }) + "\":\n";
|
|
3543
|
+
const domString = prettyDOM(el.cloneNode(false));
|
|
3544
|
+
if (includeDescription) {
|
|
3545
|
+
const descriptionString = "Description \"" + computeAccessibleDescription$1(el, { computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements }) + "\":\n";
|
|
3546
|
+
return "" + nameString + descriptionString + domString;
|
|
3547
|
+
}
|
|
3548
|
+
return "" + nameString + domString;
|
|
3549
|
+
}).join("\n\n");
|
|
3550
|
+
return role + ":\n\n" + elementsString + "\n\n" + delimiterBar;
|
|
3551
|
+
}).join("\n");
|
|
3552
|
+
}
|
|
3553
|
+
/**
|
|
3554
|
+
* @param {Element} element -
|
|
3555
|
+
* @returns {boolean | undefined} - false/true if (not)selected, undefined if not selectable
|
|
3556
|
+
*/
|
|
3557
|
+
function computeAriaSelected(element) {
|
|
3558
|
+
if (element.tagName === "OPTION") return element.selected;
|
|
3559
|
+
return checkBooleanAttribute(element, "aria-selected");
|
|
3560
|
+
}
|
|
3561
|
+
/**
|
|
3562
|
+
* @param {Element} element -
|
|
3563
|
+
* @returns {boolean} -
|
|
3564
|
+
*/
|
|
3565
|
+
function computeAriaBusy(element) {
|
|
3566
|
+
return element.getAttribute("aria-busy") === "true";
|
|
3567
|
+
}
|
|
3568
|
+
/**
|
|
3569
|
+
* @param {Element} element -
|
|
3570
|
+
* @returns {boolean | undefined} - false/true if (not)checked, undefined if not checked-able
|
|
3571
|
+
*/
|
|
3572
|
+
function computeAriaChecked(element) {
|
|
3573
|
+
if ("indeterminate" in element && element.indeterminate) return;
|
|
3574
|
+
if ("checked" in element) return element.checked;
|
|
3575
|
+
return checkBooleanAttribute(element, "aria-checked");
|
|
3576
|
+
}
|
|
3577
|
+
/**
|
|
3578
|
+
* @param {Element} element -
|
|
3579
|
+
* @returns {boolean | undefined} - false/true if (not)pressed, undefined if not press-able
|
|
3580
|
+
*/
|
|
3581
|
+
function computeAriaPressed(element) {
|
|
3582
|
+
return checkBooleanAttribute(element, "aria-pressed");
|
|
3583
|
+
}
|
|
3584
|
+
/**
|
|
3585
|
+
* @param {Element} element -
|
|
3586
|
+
* @returns {boolean | string | null} -
|
|
3587
|
+
*/
|
|
3588
|
+
function computeAriaCurrent(element) {
|
|
3589
|
+
var _ref11, _checkBooleanAttribut;
|
|
3590
|
+
return (_ref11 = (_checkBooleanAttribut = checkBooleanAttribute(element, "aria-current")) != null ? _checkBooleanAttribut : element.getAttribute("aria-current")) != null ? _ref11 : false;
|
|
3591
|
+
}
|
|
3592
|
+
/**
|
|
3593
|
+
* @param {Element} element -
|
|
3594
|
+
* @returns {boolean | undefined} - false/true if (not)expanded, undefined if not expand-able
|
|
3595
|
+
*/
|
|
3596
|
+
function computeAriaExpanded(element) {
|
|
3597
|
+
return checkBooleanAttribute(element, "aria-expanded");
|
|
3598
|
+
}
|
|
3599
|
+
function checkBooleanAttribute(element, attribute) {
|
|
3600
|
+
const attributeValue = element.getAttribute(attribute);
|
|
3601
|
+
if (attributeValue === "true") return true;
|
|
3602
|
+
if (attributeValue === "false") return false;
|
|
3603
|
+
}
|
|
3604
|
+
/**
|
|
3605
|
+
* @param {Element} element -
|
|
3606
|
+
* @returns {number | undefined} - number if implicit heading or aria-level present, otherwise undefined
|
|
3607
|
+
*/
|
|
3608
|
+
function computeHeadingLevel(element) {
|
|
3609
|
+
return element.getAttribute("aria-level") && Number(element.getAttribute("aria-level")) || {
|
|
3610
|
+
H1: 1,
|
|
3611
|
+
H2: 2,
|
|
3612
|
+
H3: 3,
|
|
3613
|
+
H4: 4,
|
|
3614
|
+
H5: 5,
|
|
3615
|
+
H6: 6
|
|
3616
|
+
}[element.tagName];
|
|
3617
|
+
}
|
|
3618
|
+
/**
|
|
3619
|
+
* @param {Element} element -
|
|
3620
|
+
* @returns {number | undefined} -
|
|
3621
|
+
*/
|
|
3622
|
+
function computeAriaValueNow(element) {
|
|
3623
|
+
const valueNow = element.getAttribute("aria-valuenow");
|
|
3624
|
+
return valueNow === null ? void 0 : +valueNow;
|
|
3625
|
+
}
|
|
3626
|
+
/**
|
|
3627
|
+
* @param {Element} element -
|
|
3628
|
+
* @returns {number | undefined} -
|
|
3629
|
+
*/
|
|
3630
|
+
function computeAriaValueMax(element) {
|
|
3631
|
+
const valueMax = element.getAttribute("aria-valuemax");
|
|
3632
|
+
return valueMax === null ? void 0 : +valueMax;
|
|
3633
|
+
}
|
|
3634
|
+
/**
|
|
3635
|
+
* @param {Element} element -
|
|
3636
|
+
* @returns {number | undefined} -
|
|
3637
|
+
*/
|
|
3638
|
+
function computeAriaValueMin(element) {
|
|
3639
|
+
const valueMin = element.getAttribute("aria-valuemin");
|
|
3640
|
+
return valueMin === null ? void 0 : +valueMin;
|
|
3641
|
+
}
|
|
3642
|
+
/**
|
|
3643
|
+
* @param {Element} element -
|
|
3644
|
+
* @returns {string | undefined} -
|
|
3645
|
+
*/
|
|
3646
|
+
function computeAriaValueText(element) {
|
|
3647
|
+
const valueText = element.getAttribute("aria-valuetext");
|
|
3648
|
+
return valueText === null ? void 0 : valueText;
|
|
3649
|
+
}
|
|
3650
|
+
function escapeRegExp(string) {
|
|
3651
|
+
return string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
|
|
3652
|
+
}
|
|
3653
|
+
function getRegExpMatcher(string) {
|
|
3654
|
+
return new RegExp(escapeRegExp(string.toLowerCase()), "i");
|
|
3655
|
+
}
|
|
3656
|
+
function makeSuggestion(queryName, element, content, _ref) {
|
|
3657
|
+
let variant = _ref.variant, name = _ref.name;
|
|
3658
|
+
let warning = "";
|
|
3659
|
+
const queryOptions = {};
|
|
3660
|
+
const queryArgs = [["Role", "TestId"].includes(queryName) ? content : getRegExpMatcher(content)];
|
|
3661
|
+
if (name) queryOptions.name = getRegExpMatcher(name);
|
|
3662
|
+
if (queryName === "Role" && isInaccessible(element)) {
|
|
3663
|
+
queryOptions.hidden = true;
|
|
3664
|
+
warning = "Element is inaccessible. This means that the element and all its children are invisible to screen readers.\n If you are using the aria-hidden prop, make sure this is the right choice for your case.\n ";
|
|
3665
|
+
}
|
|
3666
|
+
if (Object.keys(queryOptions).length > 0) queryArgs.push(queryOptions);
|
|
3667
|
+
const queryMethod = variant + "By" + queryName;
|
|
3668
|
+
return {
|
|
3669
|
+
queryName,
|
|
3670
|
+
queryMethod,
|
|
3671
|
+
queryArgs,
|
|
3672
|
+
variant,
|
|
3673
|
+
warning,
|
|
3674
|
+
toString() {
|
|
3675
|
+
if (warning) console.warn(warning);
|
|
3676
|
+
let text = queryArgs[0], options = queryArgs[1];
|
|
3677
|
+
text = typeof text === "string" ? "'" + text + "'" : text;
|
|
3678
|
+
options = options ? ", { " + Object.entries(options).map((_ref2) => {
|
|
3679
|
+
let k = _ref2[0], v = _ref2[1];
|
|
3680
|
+
return k + ": " + v;
|
|
3681
|
+
}).join(", ") + " }" : "";
|
|
3682
|
+
return queryMethod + "(" + text + options + ")";
|
|
3683
|
+
}
|
|
3684
|
+
};
|
|
3685
|
+
}
|
|
3686
|
+
function canSuggest(currentMethod, requestedMethod, data) {
|
|
3687
|
+
return data && (!requestedMethod || requestedMethod.toLowerCase() === currentMethod.toLowerCase());
|
|
3688
|
+
}
|
|
3689
|
+
function getSuggestedQuery(element, variant, method) {
|
|
3690
|
+
var _element$getAttribute, _getImplicitAriaRoles;
|
|
3691
|
+
if (variant === void 0) variant = "get";
|
|
3692
|
+
if (element.matches(getConfig().defaultIgnore)) return;
|
|
3693
|
+
const role = (_element$getAttribute = element.getAttribute("role")) != null ? _element$getAttribute : (_getImplicitAriaRoles = getImplicitAriaRoles(element)) == null ? void 0 : _getImplicitAriaRoles[0];
|
|
3694
|
+
if (role !== "generic" && canSuggest("Role", method, role)) return makeSuggestion("Role", element, role, {
|
|
3695
|
+
variant,
|
|
3696
|
+
name: computeAccessibleName$1(element, { computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements })
|
|
3697
|
+
});
|
|
3698
|
+
const labelText = getLabels(document, element).map((label) => label.content).join(" ");
|
|
3699
|
+
if (canSuggest("LabelText", method, labelText)) return makeSuggestion("LabelText", element, labelText, { variant });
|
|
3700
|
+
const placeholderText = element.getAttribute("placeholder");
|
|
3701
|
+
if (canSuggest("PlaceholderText", method, placeholderText)) return makeSuggestion("PlaceholderText", element, placeholderText, { variant });
|
|
3702
|
+
const textContent = normalize$1(getNodeText(element));
|
|
3703
|
+
if (canSuggest("Text", method, textContent)) return makeSuggestion("Text", element, textContent, { variant });
|
|
3704
|
+
if (canSuggest("DisplayValue", method, element.value)) return makeSuggestion("DisplayValue", element, normalize$1(element.value), { variant });
|
|
3705
|
+
const alt = element.getAttribute("alt");
|
|
3706
|
+
if (canSuggest("AltText", method, alt)) return makeSuggestion("AltText", element, alt, { variant });
|
|
3707
|
+
const title = element.getAttribute("title");
|
|
3708
|
+
if (canSuggest("Title", method, title)) return makeSuggestion("Title", element, title, { variant });
|
|
3709
|
+
const testId = element.getAttribute(getConfig().testIdAttribute);
|
|
3710
|
+
if (canSuggest("TestId", method, testId)) return makeSuggestion("TestId", element, testId, { variant });
|
|
3711
|
+
}
|
|
3712
|
+
function copyStackTrace(target, source) {
|
|
3713
|
+
target.stack = source.stack.replace(source.message, target.message);
|
|
3714
|
+
}
|
|
3715
|
+
function waitFor(callback, _ref) {
|
|
3716
|
+
let _ref$container = _ref.container, container = _ref$container === void 0 ? getDocument$1() : _ref$container, _ref$timeout = _ref.timeout, timeout = _ref$timeout === void 0 ? getConfig().asyncUtilTimeout : _ref$timeout, _ref$showOriginalStac = _ref.showOriginalStackTrace, showOriginalStackTrace = _ref$showOriginalStac === void 0 ? getConfig().showOriginalStackTrace : _ref$showOriginalStac, stackTraceError = _ref.stackTraceError, _ref$interval = _ref.interval, interval = _ref$interval === void 0 ? 50 : _ref$interval, _ref$onTimeout = _ref.onTimeout, onTimeout = _ref$onTimeout === void 0 ? (error) => {
|
|
3717
|
+
Object.defineProperty(error, "message", { value: getConfig().getElementError(error.message, container).message });
|
|
3718
|
+
return error;
|
|
3719
|
+
} : _ref$onTimeout, _ref$mutationObserver = _ref.mutationObserverOptions, mutationObserverOptions = _ref$mutationObserver === void 0 ? {
|
|
3720
|
+
subtree: true,
|
|
3721
|
+
childList: true,
|
|
3722
|
+
attributes: true,
|
|
3723
|
+
characterData: true
|
|
3724
|
+
} : _ref$mutationObserver;
|
|
3725
|
+
if (typeof callback !== "function") throw new TypeError("Received `callback` arg must be a function");
|
|
3726
|
+
return new Promise(async (resolve, reject) => {
|
|
3727
|
+
let lastError, intervalId, observer;
|
|
3728
|
+
let finished = false;
|
|
3729
|
+
let promiseStatus = "idle";
|
|
3730
|
+
const overallTimeoutTimer = setTimeout(handleTimeout, timeout);
|
|
3731
|
+
const usingJestFakeTimers = jestFakeTimersAreEnabled();
|
|
3732
|
+
if (usingJestFakeTimers) {
|
|
3733
|
+
const advanceTimersWrapper = getConfig().unstable_advanceTimersWrapper;
|
|
3734
|
+
checkCallback();
|
|
3735
|
+
while (!finished) {
|
|
3736
|
+
if (!jestFakeTimersAreEnabled()) {
|
|
3737
|
+
const error = /* @__PURE__ */ new Error("Changed from using fake timers to real timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to real timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830");
|
|
3738
|
+
if (!showOriginalStackTrace) copyStackTrace(error, stackTraceError);
|
|
3739
|
+
reject(error);
|
|
3740
|
+
return;
|
|
3741
|
+
}
|
|
3742
|
+
await advanceTimersWrapper(async () => {
|
|
3743
|
+
jest.advanceTimersByTime(interval);
|
|
3744
|
+
});
|
|
3745
|
+
if (finished) break;
|
|
3746
|
+
checkCallback();
|
|
3747
|
+
}
|
|
3748
|
+
} else {
|
|
3749
|
+
try {
|
|
3750
|
+
checkContainerType(container);
|
|
3751
|
+
} catch (e) {
|
|
3752
|
+
reject(e);
|
|
3753
|
+
return;
|
|
3754
|
+
}
|
|
3755
|
+
intervalId = setInterval(checkRealTimersCallback, interval);
|
|
3756
|
+
const MutationObserver = getWindowFromNode(container).MutationObserver;
|
|
3757
|
+
observer = new MutationObserver(checkRealTimersCallback);
|
|
3758
|
+
observer.observe(container, mutationObserverOptions);
|
|
3759
|
+
checkCallback();
|
|
3760
|
+
}
|
|
3761
|
+
function onDone(error, result) {
|
|
3762
|
+
finished = true;
|
|
3763
|
+
clearTimeout(overallTimeoutTimer);
|
|
3764
|
+
if (!usingJestFakeTimers) {
|
|
3765
|
+
clearInterval(intervalId);
|
|
3766
|
+
observer.disconnect();
|
|
3767
|
+
}
|
|
3768
|
+
if (error) reject(error);
|
|
3769
|
+
else resolve(result);
|
|
3770
|
+
}
|
|
3771
|
+
function checkRealTimersCallback() {
|
|
3772
|
+
if (jestFakeTimersAreEnabled()) {
|
|
3773
|
+
const error = /* @__PURE__ */ new Error("Changed from using real timers to fake timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to fake timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830");
|
|
3774
|
+
if (!showOriginalStackTrace) copyStackTrace(error, stackTraceError);
|
|
3775
|
+
return reject(error);
|
|
3776
|
+
} else return checkCallback();
|
|
3777
|
+
}
|
|
3778
|
+
function checkCallback() {
|
|
3779
|
+
if (promiseStatus === "pending") return;
|
|
3780
|
+
try {
|
|
3781
|
+
const result = runWithExpensiveErrorDiagnosticsDisabled(callback);
|
|
3782
|
+
if (typeof (result == null ? void 0 : result.then) === "function") {
|
|
3783
|
+
promiseStatus = "pending";
|
|
3784
|
+
result.then((resolvedValue) => {
|
|
3785
|
+
promiseStatus = "resolved";
|
|
3786
|
+
onDone(null, resolvedValue);
|
|
3787
|
+
}, (rejectedValue) => {
|
|
3788
|
+
promiseStatus = "rejected";
|
|
3789
|
+
lastError = rejectedValue;
|
|
3790
|
+
});
|
|
3791
|
+
} else onDone(null, result);
|
|
3792
|
+
} catch (error) {
|
|
3793
|
+
lastError = error;
|
|
3794
|
+
}
|
|
3795
|
+
}
|
|
3796
|
+
function handleTimeout() {
|
|
3797
|
+
let error;
|
|
3798
|
+
if (lastError) {
|
|
3799
|
+
error = lastError;
|
|
3800
|
+
if (!showOriginalStackTrace && error.name === "TestingLibraryElementError") copyStackTrace(error, stackTraceError);
|
|
3801
|
+
} else {
|
|
3802
|
+
error = /* @__PURE__ */ new Error("Timed out in waitFor.");
|
|
3803
|
+
if (!showOriginalStackTrace) copyStackTrace(error, stackTraceError);
|
|
3804
|
+
}
|
|
3805
|
+
onDone(onTimeout(error), null);
|
|
3806
|
+
}
|
|
3807
|
+
});
|
|
3808
|
+
}
|
|
3809
|
+
function waitForWrapper(callback, options) {
|
|
3810
|
+
const stackTraceError = /* @__PURE__ */ new Error("STACK_TRACE_MESSAGE");
|
|
3811
|
+
return getConfig().asyncWrapper(() => waitFor(callback, {
|
|
3812
|
+
stackTraceError,
|
|
3813
|
+
...options
|
|
3814
|
+
}));
|
|
3815
|
+
}
|
|
3816
|
+
function getElementError(message, container) {
|
|
3817
|
+
return getConfig().getElementError(message, container);
|
|
3818
|
+
}
|
|
3819
|
+
function getMultipleElementsFoundError(message, container) {
|
|
3820
|
+
return getElementError(message + "\n\n(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).", container);
|
|
3821
|
+
}
|
|
3822
|
+
function queryAllByAttribute(attribute, container, text, _temp) {
|
|
3823
|
+
let _ref = _temp === void 0 ? {} : _temp, _ref$exact = _ref.exact, exact = _ref$exact === void 0 ? true : _ref$exact, collapseWhitespace = _ref.collapseWhitespace, trim = _ref.trim, normalizer = _ref.normalizer;
|
|
3824
|
+
const matcher = exact ? matches : fuzzyMatches;
|
|
3825
|
+
const matchNormalizer = makeNormalizer({
|
|
3826
|
+
collapseWhitespace,
|
|
3827
|
+
trim,
|
|
3828
|
+
normalizer
|
|
3829
|
+
});
|
|
3830
|
+
return Array.from(container.querySelectorAll("[" + attribute + "]")).filter((node) => matcher(node.getAttribute(attribute), node, text, matchNormalizer));
|
|
3831
|
+
}
|
|
3832
|
+
function queryByAttribute(attribute, container, text, options) {
|
|
3833
|
+
const els = queryAllByAttribute(attribute, container, text, options);
|
|
3834
|
+
if (els.length > 1) throw getMultipleElementsFoundError("Found multiple elements by [" + attribute + "=" + text + "]", container);
|
|
3835
|
+
return els[0] || null;
|
|
3836
|
+
}
|
|
3837
|
+
function makeSingleQuery(allQuery, getMultipleError) {
|
|
3838
|
+
return function(container) {
|
|
3839
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
|
|
3840
|
+
const els = allQuery(container, ...args);
|
|
3841
|
+
if (els.length > 1) {
|
|
3842
|
+
const elementStrings = els.map((element) => getElementError(null, element).message).join("\n\n");
|
|
3843
|
+
throw getMultipleElementsFoundError(getMultipleError(container, ...args) + "\n\nHere are the matching elements:\n\n" + elementStrings, container);
|
|
3844
|
+
}
|
|
3845
|
+
return els[0] || null;
|
|
3846
|
+
};
|
|
3847
|
+
}
|
|
3848
|
+
function getSuggestionError(suggestion, container) {
|
|
3849
|
+
return getConfig().getElementError("A better query is available, try this:\n" + suggestion.toString() + "\n", container);
|
|
3850
|
+
}
|
|
3851
|
+
function makeGetAllQuery(allQuery, getMissingError) {
|
|
3852
|
+
return function(container) {
|
|
3853
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
|
|
3854
|
+
const els = allQuery(container, ...args);
|
|
3855
|
+
if (!els.length) throw getConfig().getElementError(getMissingError(container, ...args), container);
|
|
3856
|
+
return els;
|
|
3857
|
+
};
|
|
3858
|
+
}
|
|
3859
|
+
function makeFindQuery(getter) {
|
|
3860
|
+
return (container, text, options, waitForOptions) => {
|
|
3861
|
+
return waitForWrapper(() => {
|
|
3862
|
+
return getter(container, text, options);
|
|
3863
|
+
}, {
|
|
3864
|
+
container,
|
|
3865
|
+
...waitForOptions
|
|
3866
|
+
});
|
|
3867
|
+
};
|
|
3868
|
+
}
|
|
3869
|
+
function buildQueries(queryAllBy, getMultipleError, getMissingError) {
|
|
3870
|
+
const queryBy = wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllBy, getMultipleError), queryAllBy.name, "query");
|
|
3871
|
+
const getAllBy = makeGetAllQuery(queryAllBy, getMissingError);
|
|
3872
|
+
const getBy = makeSingleQuery(getAllBy, getMultipleError);
|
|
3873
|
+
const getByWithSuggestions = wrapSingleQueryWithSuggestion(getBy, queryAllBy.name, "get");
|
|
3874
|
+
return [
|
|
3875
|
+
queryBy,
|
|
3876
|
+
wrapAllByQueryWithSuggestion(getAllBy, queryAllBy.name.replace("query", "get"), "getAll"),
|
|
3877
|
+
getByWithSuggestions,
|
|
3878
|
+
makeFindQuery(wrapAllByQueryWithSuggestion(getAllBy, queryAllBy.name, "findAll")),
|
|
3879
|
+
makeFindQuery(wrapSingleQueryWithSuggestion(getBy, queryAllBy.name, "find"))
|
|
3880
|
+
];
|
|
3881
|
+
}
|
|
3882
|
+
function queryAllLabels(container) {
|
|
3883
|
+
return Array.from(container.querySelectorAll("label,input")).map((node) => {
|
|
3884
|
+
return {
|
|
3885
|
+
node,
|
|
3886
|
+
textToMatch: getLabelContent(node)
|
|
3887
|
+
};
|
|
3888
|
+
}).filter((_ref) => {
|
|
3889
|
+
return _ref.textToMatch !== null;
|
|
3890
|
+
});
|
|
3891
|
+
}
|
|
3892
|
+
function getTagNameOfElementAssociatedWithLabelViaFor(container, label) {
|
|
3893
|
+
const htmlFor = label.getAttribute("for");
|
|
3894
|
+
if (!htmlFor) return null;
|
|
3895
|
+
const element = container.querySelector("[id=\"" + htmlFor + "\"]");
|
|
3896
|
+
return element ? element.tagName.toLowerCase() : null;
|
|
3897
|
+
}
|
|
3898
|
+
function makeRoleSelector(role) {
|
|
3899
|
+
var _roleElements$get;
|
|
3900
|
+
const explicitRoleSelector = "*[role~=\"" + role + "\"]";
|
|
3901
|
+
const roleRelations = (_roleElements$get = import_lib.roleElements.get(role)) != null ? _roleElements$get : /* @__PURE__ */ new Set();
|
|
3902
|
+
const implicitRoleSelectors = new Set(Array.from(roleRelations).map((_ref2) => {
|
|
3903
|
+
return _ref2.name;
|
|
3904
|
+
}));
|
|
3905
|
+
return [explicitRoleSelector].concat(Array.from(implicitRoleSelectors)).join(",");
|
|
3906
|
+
}
|
|
3907
|
+
/**
|
|
3908
|
+
* @typedef {{[key: string]: Function}} FuncMap
|
|
3909
|
+
*/
|
|
3910
|
+
/**
|
|
3911
|
+
* @param {HTMLElement} element container
|
|
3912
|
+
* @param {FuncMap} queries object of functions
|
|
3913
|
+
* @param {Object} initialValue for reducer
|
|
3914
|
+
* @returns {FuncMap} returns object of functions bound to container
|
|
3915
|
+
*/
|
|
3916
|
+
function getQueriesForElement(element, queries$1, initialValue) {
|
|
3917
|
+
if (queries$1 === void 0) queries$1 = queries;
|
|
3918
|
+
if (initialValue === void 0) initialValue = {};
|
|
3919
|
+
return Object.keys(queries$1).reduce((helpers, key) => {
|
|
3920
|
+
helpers[key] = queries$1[key].bind(null, element);
|
|
3921
|
+
return helpers;
|
|
3922
|
+
}, initialValue);
|
|
3923
|
+
}
|
|
3924
|
+
function initialCheck(elements) {
|
|
3925
|
+
if (isRemoved(elements)) throw new Error("The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.");
|
|
3926
|
+
}
|
|
3927
|
+
async function waitForElementToBeRemoved(callback, options) {
|
|
3928
|
+
const timeoutError = /* @__PURE__ */ new Error("Timed out in waitForElementToBeRemoved.");
|
|
3929
|
+
if (typeof callback !== "function") {
|
|
3930
|
+
initialCheck(callback);
|
|
3931
|
+
const getRemainingElements = (Array.isArray(callback) ? callback : [callback]).map((element) => {
|
|
3932
|
+
let parent = element.parentElement;
|
|
3933
|
+
if (parent === null) return () => null;
|
|
3934
|
+
while (parent.parentElement) parent = parent.parentElement;
|
|
3935
|
+
return () => parent.contains(element) ? element : null;
|
|
3936
|
+
});
|
|
3937
|
+
callback = () => getRemainingElements.map((c) => c()).filter(Boolean);
|
|
3938
|
+
}
|
|
3939
|
+
initialCheck(callback());
|
|
3940
|
+
return waitForWrapper(() => {
|
|
3941
|
+
let result;
|
|
3942
|
+
try {
|
|
3943
|
+
result = callback();
|
|
3944
|
+
} catch (error) {
|
|
3945
|
+
if (error.name === "TestingLibraryElementError") return;
|
|
3946
|
+
throw error;
|
|
3947
|
+
}
|
|
3948
|
+
if (!isRemoved(result)) throw timeoutError;
|
|
3949
|
+
}, options);
|
|
3950
|
+
}
|
|
3951
|
+
function fireEvent(element, event) {
|
|
3952
|
+
return getConfig().eventWrapper(() => {
|
|
3953
|
+
if (!event) throw new Error("Unable to fire an event - please provide an event object.");
|
|
3954
|
+
if (!element) throw new Error("Unable to fire a \"" + event.type + "\" event - please provide a DOM element.");
|
|
3955
|
+
return element.dispatchEvent(event);
|
|
3956
|
+
});
|
|
3957
|
+
}
|
|
3958
|
+
function createEvent$1(eventName, node, init, _temp) {
|
|
3959
|
+
let _ref = _temp === void 0 ? {} : _temp, _ref$EventType = _ref.EventType, EventType = _ref$EventType === void 0 ? "Event" : _ref$EventType, _ref$defaultInit = _ref.defaultInit, defaultInit = _ref$defaultInit === void 0 ? {} : _ref$defaultInit;
|
|
3960
|
+
if (!node) throw new Error("Unable to fire a \"" + eventName + "\" event - please provide a DOM element.");
|
|
3961
|
+
const eventInit = {
|
|
3962
|
+
...defaultInit,
|
|
3963
|
+
...init
|
|
3964
|
+
};
|
|
3965
|
+
const _eventInit$target = eventInit.target, _eventInit$target2 = _eventInit$target === void 0 ? {} : _eventInit$target, value = _eventInit$target2.value, files = _eventInit$target2.files, targetProperties = _objectWithoutPropertiesLoose(_eventInit$target2, _excluded);
|
|
3966
|
+
if (value !== void 0) setNativeValue(node, value);
|
|
3967
|
+
if (files !== void 0) Object.defineProperty(node, "files", {
|
|
3968
|
+
configurable: true,
|
|
3969
|
+
enumerable: true,
|
|
3970
|
+
writable: true,
|
|
3971
|
+
value: files
|
|
3972
|
+
});
|
|
3973
|
+
Object.assign(node, targetProperties);
|
|
3974
|
+
const window = getWindowFromNode(node);
|
|
3975
|
+
const EventConstructor = window[EventType] || window.Event;
|
|
3976
|
+
let event;
|
|
3977
|
+
/* istanbul ignore else */
|
|
3978
|
+
if (typeof EventConstructor === "function") event = new EventConstructor(eventName, eventInit);
|
|
3979
|
+
else {
|
|
3980
|
+
event = window.document.createEvent(EventType);
|
|
3981
|
+
const bubbles = eventInit.bubbles, cancelable = eventInit.cancelable, detail = eventInit.detail, otherInit = _objectWithoutPropertiesLoose(eventInit, _excluded2);
|
|
3982
|
+
event.initEvent(eventName, bubbles, cancelable, detail);
|
|
3983
|
+
Object.keys(otherInit).forEach((eventKey) => {
|
|
3984
|
+
event[eventKey] = otherInit[eventKey];
|
|
3985
|
+
});
|
|
3986
|
+
}
|
|
3987
|
+
["dataTransfer", "clipboardData"].forEach((dataTransferKey) => {
|
|
3988
|
+
const dataTransferValue = eventInit[dataTransferKey];
|
|
3989
|
+
if (typeof dataTransferValue === "object") {
|
|
3990
|
+
/* istanbul ignore if */
|
|
3991
|
+
if (typeof window.DataTransfer === "function") Object.defineProperty(event, dataTransferKey, { value: Object.getOwnPropertyNames(dataTransferValue).reduce((acc, propName) => {
|
|
3992
|
+
Object.defineProperty(acc, propName, { value: dataTransferValue[propName] });
|
|
3993
|
+
return acc;
|
|
3994
|
+
}, new window.DataTransfer()) });
|
|
3995
|
+
else Object.defineProperty(event, dataTransferKey, { value: dataTransferValue });
|
|
3996
|
+
}
|
|
3997
|
+
});
|
|
3998
|
+
return event;
|
|
3999
|
+
}
|
|
4000
|
+
function setNativeValue(element, value) {
|
|
4001
|
+
const valueSetter = (Object.getOwnPropertyDescriptor(element, "value") || {}).set;
|
|
4002
|
+
const prototype = Object.getPrototypeOf(element);
|
|
4003
|
+
const prototypeValueSetter = (Object.getOwnPropertyDescriptor(prototype, "value") || {}).set;
|
|
4004
|
+
if (prototypeValueSetter && valueSetter !== prototypeValueSetter) prototypeValueSetter.call(element, value);
|
|
4005
|
+
else if (valueSetter) valueSetter.call(element, value);
|
|
4006
|
+
else throw new Error("The given element does not have a value setter");
|
|
4007
|
+
}
|
|
4008
|
+
function unindent(string) {
|
|
4009
|
+
return string.replace(/[ \t]*[\n][ \t]*/g, "\n");
|
|
4010
|
+
}
|
|
4011
|
+
function encode(value) {
|
|
4012
|
+
return import_lz_string.default.compressToEncodedURIComponent(unindent(value));
|
|
4013
|
+
}
|
|
4014
|
+
function getPlaygroundUrl(markup) {
|
|
4015
|
+
return "https://testing-playground.com/#markup=" + encode(markup);
|
|
4016
|
+
}
|
|
4017
|
+
var import_build, import_lib, import_lz_string, printProps, NodeTypeTextNode, printChildren, printText, printComment, printElement, printElementAsLeaf, ELEMENT_NODE$1, TEXT_NODE$1, COMMENT_NODE$1, FRAGMENT_NODE, ELEMENT_REGEXP, isCustomElement, testNode, picocolors, readFileSync, codeFrameColumns, TEXT_NODE, _excluded$1, shouldHighlight, DOMCollection, ELEMENT_NODE, COMMENT_NODE, logDOM, config, labelledNodeNames, elementRoleList, logRoles, normalize$1, wrapSingleQueryWithSuggestion, wrapAllByQueryWithSuggestion, queryHelpers, queryAllLabelsByText, queryAllByLabelText, getAllByLabelText, getMultipleError$7, queryByLabelText, getByLabelText, findAllByLabelText, findByLabelText, getAllByLabelTextWithSuggestions, getByLabelTextWithSuggestions, queryAllByLabelTextWithSuggestions, queryAllByPlaceholderText, getMultipleError$6, getMissingError$6, queryAllByPlaceholderTextWithSuggestions, _buildQueries$6, queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText, queryAllByText, getMultipleError$5, getMissingError$5, queryAllByTextWithSuggestions, _buildQueries$5, queryByText, getAllByText, getByText, findAllByText, findByText, queryAllByDisplayValue, getMultipleError$4, getMissingError$4, queryAllByDisplayValueWithSuggestions, _buildQueries$4, queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue, VALID_TAG_REGEXP, queryAllByAltText, getMultipleError$3, getMissingError$3, queryAllByAltTextWithSuggestions, _buildQueries$3, queryByAltText, getAllByAltText, getByAltText, findAllByAltText, findByAltText, isSvgTitle, queryAllByTitle, getMultipleError$2, getMissingError$2, queryAllByTitleWithSuggestions, _buildQueries$2, queryByTitle, getAllByTitle, getByTitle, findAllByTitle, findByTitle, queryAllByRole, getNameHint, getMultipleError$1, getMissingError$1, queryAllByRoleWithSuggestions, _buildQueries$1, queryByRole, getAllByRole, getByRole, findAllByRole, findByRole, getTestIdAttribute, queryAllByTestId, getMultipleError, getMissingError, queryAllByTestIdWithSuggestions, _buildQueries, queryByTestId, getAllByTestId, getByTestId, findAllByTestId, findByTestId, queries, isRemoved, eventMap$1, eventAliasMap, _excluded, _excluded2, debug, logTestingPlaygroundURL, initialValue, screen;
|
|
4018
|
+
function init_dom_esm() {
|
|
4019
|
+
return (init_dom_esm = __esmMin((() => {
|
|
4020
|
+
import_build = /* @__PURE__ */ __toESM(require_build());
|
|
4021
|
+
init_dist$1();
|
|
4022
|
+
import_lib = require_lib();
|
|
4023
|
+
import_lz_string = /* @__PURE__ */ __toESM(require_lz_string());
|
|
4024
|
+
printProps = (keys, props, config, indentation, depth, refs, printer) => {
|
|
4025
|
+
const indentationNext = indentation + config.indent;
|
|
4026
|
+
const colors = config.colors;
|
|
4027
|
+
return keys.map((key) => {
|
|
4028
|
+
const value = props[key];
|
|
4029
|
+
let printed = printer(value, config, indentationNext, depth, refs);
|
|
4030
|
+
if (typeof value !== "string") {
|
|
4031
|
+
if (printed.indexOf("\n") !== -1) printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
|
|
4032
|
+
printed = "{" + printed + "}";
|
|
4033
|
+
}
|
|
4034
|
+
return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + "=" + colors.value.open + printed + colors.value.close;
|
|
4035
|
+
}).join("");
|
|
4036
|
+
};
|
|
4037
|
+
NodeTypeTextNode = 3;
|
|
4038
|
+
printChildren = (children, config, indentation, depth, refs, printer) => children.map((child) => {
|
|
4039
|
+
const printedChild = typeof child === "string" ? printText(child, config) : printer(child, config, indentation, depth, refs);
|
|
4040
|
+
if (printedChild === "" && typeof child === "object" && child !== null && child.nodeType !== NodeTypeTextNode) return "";
|
|
4041
|
+
return config.spacingOuter + indentation + printedChild;
|
|
4042
|
+
}).join("");
|
|
4043
|
+
printText = (text, config) => {
|
|
4044
|
+
const contentColor = config.colors.content;
|
|
4045
|
+
return contentColor.open + escapeHTML(text) + contentColor.close;
|
|
4046
|
+
};
|
|
4047
|
+
printComment = (comment, config) => {
|
|
4048
|
+
const commentColor = config.colors.comment;
|
|
4049
|
+
return commentColor.open + "<!--" + escapeHTML(comment) + "-->" + commentColor.close;
|
|
4050
|
+
};
|
|
4051
|
+
printElement = (type, printedProps, printedChildren, config, indentation) => {
|
|
4052
|
+
const tagColor = config.colors.tag;
|
|
4053
|
+
return tagColor.open + "<" + type + (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) + (printedChildren ? ">" + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + "</" + type : (printedProps && !config.min ? "" : " ") + "/") + ">" + tagColor.close;
|
|
4054
|
+
};
|
|
4055
|
+
printElementAsLeaf = (type, config) => {
|
|
4056
|
+
const tagColor = config.colors.tag;
|
|
4057
|
+
return tagColor.open + "<" + type + tagColor.close + " …" + tagColor.open + " />" + tagColor.close;
|
|
4058
|
+
};
|
|
4059
|
+
ELEMENT_NODE$1 = 1;
|
|
4060
|
+
TEXT_NODE$1 = 3;
|
|
4061
|
+
COMMENT_NODE$1 = 8;
|
|
4062
|
+
FRAGMENT_NODE = 11;
|
|
4063
|
+
ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
|
|
4064
|
+
isCustomElement = (val) => {
|
|
4065
|
+
const tagName = val.tagName;
|
|
4066
|
+
return Boolean(typeof tagName === "string" && tagName.includes("-") || typeof val.hasAttribute === "function" && val.hasAttribute("is"));
|
|
4067
|
+
};
|
|
4068
|
+
testNode = (val) => {
|
|
4069
|
+
const constructorName = val.constructor.name;
|
|
4070
|
+
const nodeType = val.nodeType;
|
|
4071
|
+
return nodeType === ELEMENT_NODE$1 && (ELEMENT_REGEXP.test(constructorName) || isCustomElement(val)) || nodeType === TEXT_NODE$1 && constructorName === "Text" || nodeType === COMMENT_NODE$1 && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
|
|
4072
|
+
};
|
|
4073
|
+
picocolors = null;
|
|
4074
|
+
readFileSync = null;
|
|
4075
|
+
codeFrameColumns = null;
|
|
4076
|
+
try {
|
|
4077
|
+
const nodeRequire = module && module.require;
|
|
4078
|
+
readFileSync = nodeRequire.call(module, "fs").readFileSync;
|
|
4079
|
+
codeFrameColumns = nodeRequire.call(module, "@babel/code-frame").codeFrameColumns;
|
|
4080
|
+
picocolors = nodeRequire.call(module, "picocolors");
|
|
4081
|
+
} catch {}
|
|
4082
|
+
TEXT_NODE = 3;
|
|
4083
|
+
_excluded$1 = ["filterNode"];
|
|
4084
|
+
shouldHighlight = () => {
|
|
4085
|
+
if (typeof process === "undefined") return false;
|
|
4086
|
+
let colors;
|
|
4087
|
+
try {
|
|
4088
|
+
var _process$env;
|
|
4089
|
+
const colorsJSON = (_process$env = process.env) == null ? void 0 : _process$env.COLORS;
|
|
4090
|
+
if (colorsJSON) colors = JSON.parse(colorsJSON);
|
|
4091
|
+
} catch {}
|
|
4092
|
+
if (typeof colors === "boolean") return colors;
|
|
4093
|
+
else return process.versions !== void 0 && process.versions.node !== void 0;
|
|
4094
|
+
};
|
|
4095
|
+
DOMCollection = import_build.plugins.DOMCollection;
|
|
4096
|
+
ELEMENT_NODE = 1;
|
|
4097
|
+
COMMENT_NODE = 8;
|
|
4098
|
+
logDOM = function() {
|
|
4099
|
+
const userCodeFrame = getUserCodeFrame();
|
|
4100
|
+
if (userCodeFrame) console.log(prettyDOM(...arguments) + "\n\n" + userCodeFrame);
|
|
4101
|
+
else console.log(prettyDOM(...arguments));
|
|
4102
|
+
};
|
|
4103
|
+
config = {
|
|
4104
|
+
testIdAttribute: "data-testid",
|
|
4105
|
+
asyncUtilTimeout: 1e3,
|
|
4106
|
+
asyncWrapper: (cb) => cb(),
|
|
4107
|
+
unstable_advanceTimersWrapper: (cb) => cb(),
|
|
4108
|
+
eventWrapper: (cb) => cb(),
|
|
4109
|
+
defaultHidden: false,
|
|
4110
|
+
defaultIgnore: "script, style",
|
|
4111
|
+
showOriginalStackTrace: false,
|
|
4112
|
+
throwSuggestions: false,
|
|
4113
|
+
getElementError(message, container) {
|
|
4114
|
+
const prettifiedDOM = prettyDOM(container);
|
|
4115
|
+
const error = new Error([message, "Ignored nodes: comments, " + config.defaultIgnore + "\n" + prettifiedDOM].filter(Boolean).join("\n\n"));
|
|
4116
|
+
error.name = "TestingLibraryElementError";
|
|
4117
|
+
return error;
|
|
4118
|
+
},
|
|
4119
|
+
_disableExpensiveErrorDiagnostics: false,
|
|
4120
|
+
computedStyleSupportsPseudoElements: false
|
|
4121
|
+
};
|
|
4122
|
+
labelledNodeNames = [
|
|
4123
|
+
"button",
|
|
4124
|
+
"meter",
|
|
4125
|
+
"output",
|
|
4126
|
+
"progress",
|
|
4127
|
+
"select",
|
|
4128
|
+
"textarea",
|
|
4129
|
+
"input"
|
|
4130
|
+
];
|
|
4131
|
+
elementRoleList = buildElementRoleList(import_lib.elementRoles);
|
|
4132
|
+
logRoles = function(dom, _temp2) {
|
|
4133
|
+
let _ref10$hidden = (_temp2 === void 0 ? {} : _temp2).hidden;
|
|
4134
|
+
return console.log(prettyRoles(dom, { hidden: _ref10$hidden === void 0 ? false : _ref10$hidden }));
|
|
4135
|
+
};
|
|
4136
|
+
normalize$1 = getDefaultNormalizer();
|
|
4137
|
+
wrapSingleQueryWithSuggestion = (query, queryAllByName, variant) => function(container) {
|
|
4138
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
|
|
4139
|
+
const element = query(container, ...args);
|
|
4140
|
+
const _ref2$ = args.slice(-1)[0], _ref2$2$suggest = (_ref2$ === void 0 ? {} : _ref2$).suggest, suggest = _ref2$2$suggest === void 0 ? getConfig().throwSuggestions : _ref2$2$suggest;
|
|
4141
|
+
if (element && suggest) {
|
|
4142
|
+
const suggestion = getSuggestedQuery(element, variant);
|
|
4143
|
+
if (suggestion && !queryAllByName.endsWith(suggestion.queryName)) throw getSuggestionError(suggestion.toString(), container);
|
|
4144
|
+
}
|
|
4145
|
+
return element;
|
|
4146
|
+
};
|
|
4147
|
+
wrapAllByQueryWithSuggestion = (query, queryAllByName, variant) => function(container) {
|
|
4148
|
+
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) args[_key4 - 1] = arguments[_key4];
|
|
4149
|
+
const els = query(container, ...args);
|
|
4150
|
+
const _ref3$ = args.slice(-1)[0], _ref3$2$suggest = (_ref3$ === void 0 ? {} : _ref3$).suggest, suggest = _ref3$2$suggest === void 0 ? getConfig().throwSuggestions : _ref3$2$suggest;
|
|
4151
|
+
if (els.length && suggest) {
|
|
4152
|
+
const uniqueSuggestionMessages = [...new Set(els.map((element) => {
|
|
4153
|
+
var _getSuggestedQuery;
|
|
4154
|
+
return (_getSuggestedQuery = getSuggestedQuery(element, variant)) == null ? void 0 : _getSuggestedQuery.toString();
|
|
4155
|
+
}))];
|
|
4156
|
+
if (uniqueSuggestionMessages.length === 1 && !queryAllByName.endsWith(getSuggestedQuery(els[0], variant).queryName)) throw getSuggestionError(uniqueSuggestionMessages[0], container);
|
|
4157
|
+
}
|
|
4158
|
+
return els;
|
|
4159
|
+
};
|
|
4160
|
+
queryHelpers = /*#__PURE__*/ Object.freeze({
|
|
4161
|
+
__proto__: null,
|
|
4162
|
+
getElementError,
|
|
4163
|
+
wrapAllByQueryWithSuggestion,
|
|
4164
|
+
wrapSingleQueryWithSuggestion,
|
|
4165
|
+
getMultipleElementsFoundError,
|
|
4166
|
+
queryAllByAttribute,
|
|
4167
|
+
queryByAttribute,
|
|
4168
|
+
makeSingleQuery,
|
|
4169
|
+
makeGetAllQuery,
|
|
4170
|
+
makeFindQuery,
|
|
4171
|
+
buildQueries
|
|
4172
|
+
});
|
|
4173
|
+
queryAllLabelsByText = function(container, text, _temp) {
|
|
4174
|
+
let _ref2 = _temp === void 0 ? {} : _temp, _ref2$exact = _ref2.exact, exact = _ref2$exact === void 0 ? true : _ref2$exact, trim = _ref2.trim, collapseWhitespace = _ref2.collapseWhitespace, normalizer = _ref2.normalizer;
|
|
4175
|
+
const matcher = exact ? matches : fuzzyMatches;
|
|
4176
|
+
const matchNormalizer = makeNormalizer({
|
|
4177
|
+
collapseWhitespace,
|
|
4178
|
+
trim,
|
|
4179
|
+
normalizer
|
|
4180
|
+
});
|
|
4181
|
+
return queryAllLabels(container).filter((_ref3) => {
|
|
4182
|
+
let node = _ref3.node, textToMatch = _ref3.textToMatch;
|
|
4183
|
+
return matcher(textToMatch, node, text, matchNormalizer);
|
|
4184
|
+
}).map((_ref4) => {
|
|
4185
|
+
return _ref4.node;
|
|
4186
|
+
});
|
|
4187
|
+
};
|
|
4188
|
+
queryAllByLabelText = function(container, text, _temp2) {
|
|
4189
|
+
let _ref5 = _temp2 === void 0 ? {} : _temp2, _ref5$selector = _ref5.selector, selector = _ref5$selector === void 0 ? "*" : _ref5$selector, _ref5$exact = _ref5.exact, exact = _ref5$exact === void 0 ? true : _ref5$exact, collapseWhitespace = _ref5.collapseWhitespace, trim = _ref5.trim, normalizer = _ref5.normalizer;
|
|
4190
|
+
checkContainerType(container);
|
|
4191
|
+
const matcher = exact ? matches : fuzzyMatches;
|
|
4192
|
+
const matchNormalizer = makeNormalizer({
|
|
4193
|
+
collapseWhitespace,
|
|
4194
|
+
trim,
|
|
4195
|
+
normalizer
|
|
4196
|
+
});
|
|
4197
|
+
const matchingLabelledElements = Array.from(container.querySelectorAll("*")).filter((element) => {
|
|
4198
|
+
return getRealLabels(element).length || element.hasAttribute("aria-labelledby");
|
|
4199
|
+
}).reduce((labelledElements, labelledElement) => {
|
|
4200
|
+
const labelList = getLabels(container, labelledElement, { selector });
|
|
4201
|
+
labelList.filter((label) => Boolean(label.formControl)).forEach((label) => {
|
|
4202
|
+
if (matcher(label.content, label.formControl, text, matchNormalizer) && label.formControl) labelledElements.push(label.formControl);
|
|
4203
|
+
});
|
|
4204
|
+
const labelsValue = labelList.filter((label) => Boolean(label.content)).map((label) => label.content);
|
|
4205
|
+
if (matcher(labelsValue.join(" "), labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);
|
|
4206
|
+
if (labelsValue.length > 1) labelsValue.forEach((labelValue, index) => {
|
|
4207
|
+
if (matcher(labelValue, labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);
|
|
4208
|
+
const labelsFiltered = [...labelsValue];
|
|
4209
|
+
labelsFiltered.splice(index, 1);
|
|
4210
|
+
if (labelsFiltered.length > 1) {
|
|
4211
|
+
if (matcher(labelsFiltered.join(" "), labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);
|
|
4212
|
+
}
|
|
4213
|
+
});
|
|
4214
|
+
return labelledElements;
|
|
4215
|
+
}, []).concat(queryAllByAttribute("aria-label", container, text, {
|
|
4216
|
+
exact,
|
|
4217
|
+
normalizer: matchNormalizer
|
|
4218
|
+
}));
|
|
4219
|
+
return Array.from(new Set(matchingLabelledElements)).filter((element) => element.matches(selector));
|
|
4220
|
+
};
|
|
4221
|
+
getAllByLabelText = function(container, text) {
|
|
4222
|
+
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) rest[_key - 2] = arguments[_key];
|
|
4223
|
+
const els = queryAllByLabelText(container, text, ...rest);
|
|
4224
|
+
if (!els.length) {
|
|
4225
|
+
const labels = queryAllLabelsByText(container, text, ...rest);
|
|
4226
|
+
if (labels.length) {
|
|
4227
|
+
const tagNames = labels.map((label) => getTagNameOfElementAssociatedWithLabelViaFor(container, label)).filter((tagName) => !!tagName);
|
|
4228
|
+
if (tagNames.length) throw getConfig().getElementError(tagNames.map((tagName) => "Found a label with the text of: " + text + ", however the element associated with this label (<" + tagName + " />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <" + tagName + " />, you can use aria-label or aria-labelledby instead.").join("\n\n"), container);
|
|
4229
|
+
else throw getConfig().getElementError("Found a label with the text of: " + text + ", however no form control was found associated to that label. Make sure you're using the \"for\" attribute or \"aria-labelledby\" attribute correctly.", container);
|
|
4230
|
+
} else throw getConfig().getElementError("Unable to find a label with the text of: " + text, container);
|
|
4231
|
+
}
|
|
4232
|
+
return els;
|
|
4233
|
+
};
|
|
4234
|
+
getMultipleError$7 = (c, text) => "Found multiple elements with the text of: " + text;
|
|
4235
|
+
queryByLabelText = wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllByLabelText, getMultipleError$7), queryAllByLabelText.name, "query");
|
|
4236
|
+
getByLabelText = makeSingleQuery(getAllByLabelText, getMultipleError$7);
|
|
4237
|
+
findAllByLabelText = makeFindQuery(wrapAllByQueryWithSuggestion(getAllByLabelText, getAllByLabelText.name, "findAll"));
|
|
4238
|
+
findByLabelText = makeFindQuery(wrapSingleQueryWithSuggestion(getByLabelText, getAllByLabelText.name, "find"));
|
|
4239
|
+
getAllByLabelTextWithSuggestions = wrapAllByQueryWithSuggestion(getAllByLabelText, getAllByLabelText.name, "getAll");
|
|
4240
|
+
getByLabelTextWithSuggestions = wrapSingleQueryWithSuggestion(getByLabelText, getAllByLabelText.name, "get");
|
|
4241
|
+
queryAllByLabelTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByLabelText, queryAllByLabelText.name, "queryAll");
|
|
4242
|
+
queryAllByPlaceholderText = function() {
|
|
4243
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
4244
|
+
checkContainerType(args[0]);
|
|
4245
|
+
return queryAllByAttribute("placeholder", ...args);
|
|
4246
|
+
};
|
|
4247
|
+
getMultipleError$6 = (c, text) => "Found multiple elements with the placeholder text of: " + text;
|
|
4248
|
+
getMissingError$6 = (c, text) => "Unable to find an element with the placeholder text of: " + text;
|
|
4249
|
+
queryAllByPlaceholderTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByPlaceholderText, queryAllByPlaceholderText.name, "queryAll");
|
|
4250
|
+
_buildQueries$6 = buildQueries(queryAllByPlaceholderText, getMultipleError$6, getMissingError$6);
|
|
4251
|
+
queryByPlaceholderText = _buildQueries$6[0];
|
|
4252
|
+
getAllByPlaceholderText = _buildQueries$6[1];
|
|
4253
|
+
getByPlaceholderText = _buildQueries$6[2];
|
|
4254
|
+
findAllByPlaceholderText = _buildQueries$6[3];
|
|
4255
|
+
findByPlaceholderText = _buildQueries$6[4];
|
|
4256
|
+
queryAllByText = function(container, text, _temp) {
|
|
4257
|
+
let _ref = _temp === void 0 ? {} : _temp, _ref$selector = _ref.selector, selector = _ref$selector === void 0 ? "*" : _ref$selector, _ref$exact = _ref.exact, exact = _ref$exact === void 0 ? true : _ref$exact, collapseWhitespace = _ref.collapseWhitespace, trim = _ref.trim, _ref$ignore = _ref.ignore, ignore = _ref$ignore === void 0 ? getConfig().defaultIgnore : _ref$ignore, normalizer = _ref.normalizer;
|
|
4258
|
+
checkContainerType(container);
|
|
4259
|
+
const matcher = exact ? matches : fuzzyMatches;
|
|
4260
|
+
const matchNormalizer = makeNormalizer({
|
|
4261
|
+
collapseWhitespace,
|
|
4262
|
+
trim,
|
|
4263
|
+
normalizer
|
|
4264
|
+
});
|
|
4265
|
+
let baseArray = [];
|
|
4266
|
+
if (typeof container.matches === "function" && container.matches(selector)) baseArray = [container];
|
|
4267
|
+
return [...baseArray, ...Array.from(container.querySelectorAll(selector))].filter((node) => !ignore || !node.matches(ignore)).filter((node) => matcher(getNodeText(node), node, text, matchNormalizer));
|
|
4268
|
+
};
|
|
4269
|
+
getMultipleError$5 = (c, text) => "Found multiple elements with the text: " + text;
|
|
4270
|
+
getMissingError$5 = function(c, text, options) {
|
|
4271
|
+
if (options === void 0) options = {};
|
|
4272
|
+
const _options = options, collapseWhitespace = _options.collapseWhitespace, trim = _options.trim, normalizer = _options.normalizer, selector = _options.selector;
|
|
4273
|
+
const normalizedText = makeNormalizer({
|
|
4274
|
+
collapseWhitespace,
|
|
4275
|
+
trim,
|
|
4276
|
+
normalizer
|
|
4277
|
+
})(text.toString());
|
|
4278
|
+
const isNormalizedDifferent = normalizedText !== text.toString();
|
|
4279
|
+
const isCustomSelector = (selector != null ? selector : "*") !== "*";
|
|
4280
|
+
return "Unable to find an element with the text: " + (isNormalizedDifferent ? normalizedText + " (normalized from '" + text + "')" : text) + (isCustomSelector ? ", which matches selector '" + selector + "'" : "") + ". This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.";
|
|
4281
|
+
};
|
|
4282
|
+
queryAllByTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByText, queryAllByText.name, "queryAll");
|
|
4283
|
+
_buildQueries$5 = buildQueries(queryAllByText, getMultipleError$5, getMissingError$5);
|
|
4284
|
+
queryByText = _buildQueries$5[0];
|
|
4285
|
+
getAllByText = _buildQueries$5[1];
|
|
4286
|
+
getByText = _buildQueries$5[2];
|
|
4287
|
+
findAllByText = _buildQueries$5[3];
|
|
4288
|
+
findByText = _buildQueries$5[4];
|
|
4289
|
+
queryAllByDisplayValue = function(container, value, _temp) {
|
|
4290
|
+
let _ref = _temp === void 0 ? {} : _temp, _ref$exact = _ref.exact, exact = _ref$exact === void 0 ? true : _ref$exact, collapseWhitespace = _ref.collapseWhitespace, trim = _ref.trim, normalizer = _ref.normalizer;
|
|
4291
|
+
checkContainerType(container);
|
|
4292
|
+
const matcher = exact ? matches : fuzzyMatches;
|
|
4293
|
+
const matchNormalizer = makeNormalizer({
|
|
4294
|
+
collapseWhitespace,
|
|
4295
|
+
trim,
|
|
4296
|
+
normalizer
|
|
4297
|
+
});
|
|
4298
|
+
return Array.from(container.querySelectorAll("input,textarea,select")).filter((node) => {
|
|
4299
|
+
if (node.tagName === "SELECT") return Array.from(node.options).filter((option) => option.selected).some((optionNode) => matcher(getNodeText(optionNode), optionNode, value, matchNormalizer));
|
|
4300
|
+
else return matcher(node.value, node, value, matchNormalizer);
|
|
4301
|
+
});
|
|
4302
|
+
};
|
|
4303
|
+
getMultipleError$4 = (c, value) => "Found multiple elements with the display value: " + value + ".";
|
|
4304
|
+
getMissingError$4 = (c, value) => "Unable to find an element with the display value: " + value + ".";
|
|
4305
|
+
queryAllByDisplayValueWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByDisplayValue, queryAllByDisplayValue.name, "queryAll");
|
|
4306
|
+
_buildQueries$4 = buildQueries(queryAllByDisplayValue, getMultipleError$4, getMissingError$4);
|
|
4307
|
+
queryByDisplayValue = _buildQueries$4[0];
|
|
4308
|
+
getAllByDisplayValue = _buildQueries$4[1];
|
|
4309
|
+
getByDisplayValue = _buildQueries$4[2];
|
|
4310
|
+
findAllByDisplayValue = _buildQueries$4[3];
|
|
4311
|
+
findByDisplayValue = _buildQueries$4[4];
|
|
4312
|
+
VALID_TAG_REGEXP = /^(img|input|area|.+-.+)$/i;
|
|
4313
|
+
queryAllByAltText = function(container, alt, options) {
|
|
4314
|
+
if (options === void 0) options = {};
|
|
4315
|
+
checkContainerType(container);
|
|
4316
|
+
return queryAllByAttribute("alt", container, alt, options).filter((node) => VALID_TAG_REGEXP.test(node.tagName));
|
|
4317
|
+
};
|
|
4318
|
+
getMultipleError$3 = (c, alt) => "Found multiple elements with the alt text: " + alt;
|
|
4319
|
+
getMissingError$3 = (c, alt) => "Unable to find an element with the alt text: " + alt;
|
|
4320
|
+
queryAllByAltTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByAltText, queryAllByAltText.name, "queryAll");
|
|
4321
|
+
_buildQueries$3 = buildQueries(queryAllByAltText, getMultipleError$3, getMissingError$3);
|
|
4322
|
+
queryByAltText = _buildQueries$3[0];
|
|
4323
|
+
getAllByAltText = _buildQueries$3[1];
|
|
4324
|
+
getByAltText = _buildQueries$3[2];
|
|
4325
|
+
findAllByAltText = _buildQueries$3[3];
|
|
4326
|
+
findByAltText = _buildQueries$3[4];
|
|
4327
|
+
isSvgTitle = (node) => {
|
|
4328
|
+
var _node$parentElement;
|
|
4329
|
+
return node.tagName.toLowerCase() === "title" && ((_node$parentElement = node.parentElement) == null ? void 0 : _node$parentElement.tagName.toLowerCase()) === "svg";
|
|
4330
|
+
};
|
|
4331
|
+
queryAllByTitle = function(container, text, _temp) {
|
|
4332
|
+
let _ref = _temp === void 0 ? {} : _temp, _ref$exact = _ref.exact, exact = _ref$exact === void 0 ? true : _ref$exact, collapseWhitespace = _ref.collapseWhitespace, trim = _ref.trim, normalizer = _ref.normalizer;
|
|
4333
|
+
checkContainerType(container);
|
|
4334
|
+
const matcher = exact ? matches : fuzzyMatches;
|
|
4335
|
+
const matchNormalizer = makeNormalizer({
|
|
4336
|
+
collapseWhitespace,
|
|
4337
|
+
trim,
|
|
4338
|
+
normalizer
|
|
4339
|
+
});
|
|
4340
|
+
return Array.from(container.querySelectorAll("[title], svg > title")).filter((node) => matcher(node.getAttribute("title"), node, text, matchNormalizer) || isSvgTitle(node) && matcher(getNodeText(node), node, text, matchNormalizer));
|
|
4341
|
+
};
|
|
4342
|
+
getMultipleError$2 = (c, title) => "Found multiple elements with the title: " + title + ".";
|
|
4343
|
+
getMissingError$2 = (c, title) => "Unable to find an element with the title: " + title + ".";
|
|
4344
|
+
queryAllByTitleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTitle, queryAllByTitle.name, "queryAll");
|
|
4345
|
+
_buildQueries$2 = buildQueries(queryAllByTitle, getMultipleError$2, getMissingError$2);
|
|
4346
|
+
queryByTitle = _buildQueries$2[0];
|
|
4347
|
+
getAllByTitle = _buildQueries$2[1];
|
|
4348
|
+
getByTitle = _buildQueries$2[2];
|
|
4349
|
+
findAllByTitle = _buildQueries$2[3];
|
|
4350
|
+
findByTitle = _buildQueries$2[4];
|
|
4351
|
+
queryAllByRole = function(container, role, _temp) {
|
|
4352
|
+
let _ref = _temp === void 0 ? {} : _temp, _ref$hidden = _ref.hidden, hidden = _ref$hidden === void 0 ? getConfig().defaultHidden : _ref$hidden, name = _ref.name, description = _ref.description, _ref$queryFallbacks = _ref.queryFallbacks, queryFallbacks = _ref$queryFallbacks === void 0 ? false : _ref$queryFallbacks, selected = _ref.selected, busy = _ref.busy, checked = _ref.checked, pressed = _ref.pressed, current = _ref.current, level = _ref.level, expanded = _ref.expanded, _ref$value = _ref.value, _ref$value2 = _ref$value === void 0 ? {} : _ref$value, valueNow = _ref$value2.now, valueMin = _ref$value2.min, valueMax = _ref$value2.max, valueText = _ref$value2.text;
|
|
4353
|
+
checkContainerType(container);
|
|
4354
|
+
if (selected !== void 0) {
|
|
4355
|
+
var _allRoles$get;
|
|
4356
|
+
if (((_allRoles$get = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get.props["aria-selected"]) === void 0) throw new Error("\"aria-selected\" is not supported on role \"" + role + "\".");
|
|
4357
|
+
}
|
|
4358
|
+
if (busy !== void 0) {
|
|
4359
|
+
var _allRoles$get2;
|
|
4360
|
+
if (((_allRoles$get2 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get2.props["aria-busy"]) === void 0) throw new Error("\"aria-busy\" is not supported on role \"" + role + "\".");
|
|
4361
|
+
}
|
|
4362
|
+
if (checked !== void 0) {
|
|
4363
|
+
var _allRoles$get3;
|
|
4364
|
+
if (((_allRoles$get3 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get3.props["aria-checked"]) === void 0) throw new Error("\"aria-checked\" is not supported on role \"" + role + "\".");
|
|
4365
|
+
}
|
|
4366
|
+
if (pressed !== void 0) {
|
|
4367
|
+
var _allRoles$get4;
|
|
4368
|
+
if (((_allRoles$get4 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get4.props["aria-pressed"]) === void 0) throw new Error("\"aria-pressed\" is not supported on role \"" + role + "\".");
|
|
4369
|
+
}
|
|
4370
|
+
if (current !== void 0) {
|
|
4371
|
+
var _allRoles$get5;
|
|
4372
|
+
/* istanbul ignore next */
|
|
4373
|
+
if (((_allRoles$get5 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get5.props["aria-current"]) === void 0) throw new Error("\"aria-current\" is not supported on role \"" + role + "\".");
|
|
4374
|
+
}
|
|
4375
|
+
if (level !== void 0) {
|
|
4376
|
+
if (role !== "heading") throw new Error("Role \"" + role + "\" cannot have \"level\" property.");
|
|
4377
|
+
}
|
|
4378
|
+
if (valueNow !== void 0) {
|
|
4379
|
+
var _allRoles$get6;
|
|
4380
|
+
if (((_allRoles$get6 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get6.props["aria-valuenow"]) === void 0) throw new Error("\"aria-valuenow\" is not supported on role \"" + role + "\".");
|
|
4381
|
+
}
|
|
4382
|
+
if (valueMax !== void 0) {
|
|
4383
|
+
var _allRoles$get7;
|
|
4384
|
+
if (((_allRoles$get7 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get7.props["aria-valuemax"]) === void 0) throw new Error("\"aria-valuemax\" is not supported on role \"" + role + "\".");
|
|
4385
|
+
}
|
|
4386
|
+
if (valueMin !== void 0) {
|
|
4387
|
+
var _allRoles$get8;
|
|
4388
|
+
if (((_allRoles$get8 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get8.props["aria-valuemin"]) === void 0) throw new Error("\"aria-valuemin\" is not supported on role \"" + role + "\".");
|
|
4389
|
+
}
|
|
4390
|
+
if (valueText !== void 0) {
|
|
4391
|
+
var _allRoles$get9;
|
|
4392
|
+
if (((_allRoles$get9 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get9.props["aria-valuetext"]) === void 0) throw new Error("\"aria-valuetext\" is not supported on role \"" + role + "\".");
|
|
4393
|
+
}
|
|
4394
|
+
if (expanded !== void 0) {
|
|
4395
|
+
var _allRoles$get0;
|
|
4396
|
+
if (((_allRoles$get0 = import_lib.roles.get(role)) == null ? void 0 : _allRoles$get0.props["aria-expanded"]) === void 0) throw new Error("\"aria-expanded\" is not supported on role \"" + role + "\".");
|
|
4397
|
+
}
|
|
4398
|
+
const subtreeIsInaccessibleCache = /* @__PURE__ */ new WeakMap();
|
|
4399
|
+
function cachedIsSubtreeInaccessible(element) {
|
|
4400
|
+
if (!subtreeIsInaccessibleCache.has(element)) subtreeIsInaccessibleCache.set(element, isSubtreeInaccessible(element));
|
|
4401
|
+
return subtreeIsInaccessibleCache.get(element);
|
|
4402
|
+
}
|
|
4403
|
+
return Array.from(container.querySelectorAll(makeRoleSelector(role))).filter((node) => {
|
|
4404
|
+
if (node.hasAttribute("role")) {
|
|
4405
|
+
const roleValue = node.getAttribute("role");
|
|
4406
|
+
if (queryFallbacks) return roleValue.split(" ").filter(Boolean).some((roleAttributeToken) => roleAttributeToken === role);
|
|
4407
|
+
return roleValue.split(" ")[0] === role;
|
|
4408
|
+
}
|
|
4409
|
+
return getImplicitAriaRoles(node).some((implicitRole) => {
|
|
4410
|
+
return implicitRole === role;
|
|
4411
|
+
});
|
|
4412
|
+
}).filter((element) => {
|
|
4413
|
+
if (selected !== void 0) return selected === computeAriaSelected(element);
|
|
4414
|
+
if (busy !== void 0) return busy === computeAriaBusy(element);
|
|
4415
|
+
if (checked !== void 0) return checked === computeAriaChecked(element);
|
|
4416
|
+
if (pressed !== void 0) return pressed === computeAriaPressed(element);
|
|
4417
|
+
if (current !== void 0) return current === computeAriaCurrent(element);
|
|
4418
|
+
if (expanded !== void 0) return expanded === computeAriaExpanded(element);
|
|
4419
|
+
if (level !== void 0) return level === computeHeadingLevel(element);
|
|
4420
|
+
if (valueNow !== void 0 || valueMax !== void 0 || valueMin !== void 0 || valueText !== void 0) {
|
|
4421
|
+
let valueMatches = true;
|
|
4422
|
+
if (valueNow !== void 0) valueMatches && (valueMatches = valueNow === computeAriaValueNow(element));
|
|
4423
|
+
if (valueMax !== void 0) valueMatches && (valueMatches = valueMax === computeAriaValueMax(element));
|
|
4424
|
+
if (valueMin !== void 0) valueMatches && (valueMatches = valueMin === computeAriaValueMin(element));
|
|
4425
|
+
if (valueText !== void 0) {
|
|
4426
|
+
var _computeAriaValueText;
|
|
4427
|
+
valueMatches && (valueMatches = matches((_computeAriaValueText = computeAriaValueText(element)) != null ? _computeAriaValueText : null, element, valueText, (text) => text));
|
|
4428
|
+
}
|
|
4429
|
+
return valueMatches;
|
|
4430
|
+
}
|
|
4431
|
+
return true;
|
|
4432
|
+
}).filter((element) => {
|
|
4433
|
+
if (name === void 0) return true;
|
|
4434
|
+
return matches(computeAccessibleName$1(element, { computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements }), element, name, (text) => text);
|
|
4435
|
+
}).filter((element) => {
|
|
4436
|
+
if (description === void 0) return true;
|
|
4437
|
+
return matches(computeAccessibleDescription$1(element, { computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements }), element, description, (text) => text);
|
|
4438
|
+
}).filter((element) => {
|
|
4439
|
+
return hidden === false ? isInaccessible(element, { isSubtreeInaccessible: cachedIsSubtreeInaccessible }) === false : true;
|
|
4440
|
+
});
|
|
4441
|
+
};
|
|
4442
|
+
getNameHint = (name) => {
|
|
4443
|
+
let nameHint = "";
|
|
4444
|
+
if (name === void 0) nameHint = "";
|
|
4445
|
+
else if (typeof name === "string") nameHint = " and name \"" + name + "\"";
|
|
4446
|
+
else nameHint = " and name `" + name + "`";
|
|
4447
|
+
return nameHint;
|
|
4448
|
+
};
|
|
4449
|
+
getMultipleError$1 = function(c, role, _temp2) {
|
|
4450
|
+
let name = (_temp2 === void 0 ? {} : _temp2).name;
|
|
4451
|
+
return "Found multiple elements with the role \"" + role + "\"" + getNameHint(name);
|
|
4452
|
+
};
|
|
4453
|
+
getMissingError$1 = function(container, role, _temp3) {
|
|
4454
|
+
let _ref4 = _temp3 === void 0 ? {} : _temp3, _ref4$hidden = _ref4.hidden, hidden = _ref4$hidden === void 0 ? getConfig().defaultHidden : _ref4$hidden, name = _ref4.name, description = _ref4.description;
|
|
4455
|
+
if (getConfig()._disableExpensiveErrorDiagnostics) return "Unable to find role=\"" + role + "\"" + getNameHint(name);
|
|
4456
|
+
let roles = "";
|
|
4457
|
+
Array.from(container.children).forEach((childElement) => {
|
|
4458
|
+
roles += prettyRoles(childElement, {
|
|
4459
|
+
hidden,
|
|
4460
|
+
includeDescription: description !== void 0
|
|
4461
|
+
});
|
|
4462
|
+
});
|
|
4463
|
+
let roleMessage;
|
|
4464
|
+
if (roles.length === 0) {
|
|
4465
|
+
if (hidden === false) roleMessage = "There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the `hidden` option to `true`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole";
|
|
4466
|
+
else roleMessage = "There are no available roles.";
|
|
4467
|
+
} else roleMessage = ("\nHere are the " + (hidden === false ? "accessible" : "available") + " roles:\n\n " + roles.replace(/\n/g, "\n ").replace(/\n\s\s\n/g, "\n\n") + "\n").trim();
|
|
4468
|
+
let nameHint = "";
|
|
4469
|
+
if (name === void 0) nameHint = "";
|
|
4470
|
+
else if (typeof name === "string") nameHint = " and name \"" + name + "\"";
|
|
4471
|
+
else nameHint = " and name `" + name + "`";
|
|
4472
|
+
let descriptionHint = "";
|
|
4473
|
+
if (description === void 0) descriptionHint = "";
|
|
4474
|
+
else if (typeof description === "string") descriptionHint = " and description \"" + description + "\"";
|
|
4475
|
+
else descriptionHint = " and description `" + description + "`";
|
|
4476
|
+
return ("\nUnable to find an " + (hidden === false ? "accessible " : "") + "element with the role \"" + role + "\"" + nameHint + descriptionHint + "\n\n" + roleMessage).trim();
|
|
4477
|
+
};
|
|
4478
|
+
queryAllByRoleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByRole, queryAllByRole.name, "queryAll");
|
|
4479
|
+
_buildQueries$1 = buildQueries(queryAllByRole, getMultipleError$1, getMissingError$1);
|
|
4480
|
+
queryByRole = _buildQueries$1[0];
|
|
4481
|
+
getAllByRole = _buildQueries$1[1];
|
|
4482
|
+
getByRole = _buildQueries$1[2];
|
|
4483
|
+
findAllByRole = _buildQueries$1[3];
|
|
4484
|
+
findByRole = _buildQueries$1[4];
|
|
4485
|
+
getTestIdAttribute = () => getConfig().testIdAttribute;
|
|
4486
|
+
queryAllByTestId = function() {
|
|
4487
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
4488
|
+
checkContainerType(args[0]);
|
|
4489
|
+
return queryAllByAttribute(getTestIdAttribute(), ...args);
|
|
4490
|
+
};
|
|
4491
|
+
getMultipleError = (c, id) => "Found multiple elements by: [" + getTestIdAttribute() + "=\"" + id + "\"]";
|
|
4492
|
+
getMissingError = (c, id) => "Unable to find an element by: [" + getTestIdAttribute() + "=\"" + id + "\"]";
|
|
4493
|
+
queryAllByTestIdWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTestId, queryAllByTestId.name, "queryAll");
|
|
4494
|
+
_buildQueries = buildQueries(queryAllByTestId, getMultipleError, getMissingError);
|
|
4495
|
+
queryByTestId = _buildQueries[0];
|
|
4496
|
+
getAllByTestId = _buildQueries[1];
|
|
4497
|
+
getByTestId = _buildQueries[2];
|
|
4498
|
+
findAllByTestId = _buildQueries[3];
|
|
4499
|
+
findByTestId = _buildQueries[4];
|
|
4500
|
+
queries = /*#__PURE__*/ Object.freeze({
|
|
4501
|
+
__proto__: null,
|
|
4502
|
+
queryAllByLabelText: queryAllByLabelTextWithSuggestions,
|
|
4503
|
+
queryByLabelText,
|
|
4504
|
+
getAllByLabelText: getAllByLabelTextWithSuggestions,
|
|
4505
|
+
getByLabelText: getByLabelTextWithSuggestions,
|
|
4506
|
+
findAllByLabelText,
|
|
4507
|
+
findByLabelText,
|
|
4508
|
+
queryByPlaceholderText,
|
|
4509
|
+
queryAllByPlaceholderText: queryAllByPlaceholderTextWithSuggestions,
|
|
4510
|
+
getByPlaceholderText,
|
|
4511
|
+
getAllByPlaceholderText,
|
|
4512
|
+
findAllByPlaceholderText,
|
|
4513
|
+
findByPlaceholderText,
|
|
4514
|
+
queryByText,
|
|
4515
|
+
queryAllByText: queryAllByTextWithSuggestions,
|
|
4516
|
+
getByText,
|
|
4517
|
+
getAllByText,
|
|
4518
|
+
findAllByText,
|
|
4519
|
+
findByText,
|
|
4520
|
+
queryByDisplayValue,
|
|
4521
|
+
queryAllByDisplayValue: queryAllByDisplayValueWithSuggestions,
|
|
4522
|
+
getByDisplayValue,
|
|
4523
|
+
getAllByDisplayValue,
|
|
4524
|
+
findAllByDisplayValue,
|
|
4525
|
+
findByDisplayValue,
|
|
4526
|
+
queryByAltText,
|
|
4527
|
+
queryAllByAltText: queryAllByAltTextWithSuggestions,
|
|
4528
|
+
getByAltText,
|
|
4529
|
+
getAllByAltText,
|
|
4530
|
+
findAllByAltText,
|
|
4531
|
+
findByAltText,
|
|
4532
|
+
queryByTitle,
|
|
4533
|
+
queryAllByTitle: queryAllByTitleWithSuggestions,
|
|
4534
|
+
getByTitle,
|
|
4535
|
+
getAllByTitle,
|
|
4536
|
+
findAllByTitle,
|
|
4537
|
+
findByTitle,
|
|
4538
|
+
queryByRole,
|
|
4539
|
+
queryAllByRole: queryAllByRoleWithSuggestions,
|
|
4540
|
+
getAllByRole,
|
|
4541
|
+
getByRole,
|
|
4542
|
+
findAllByRole,
|
|
4543
|
+
findByRole,
|
|
4544
|
+
queryByTestId,
|
|
4545
|
+
queryAllByTestId: queryAllByTestIdWithSuggestions,
|
|
4546
|
+
getByTestId,
|
|
4547
|
+
getAllByTestId,
|
|
4548
|
+
findAllByTestId,
|
|
4549
|
+
findByTestId
|
|
4550
|
+
});
|
|
4551
|
+
isRemoved = (result) => !result || Array.isArray(result) && !result.length;
|
|
4552
|
+
eventMap$1 = {
|
|
4553
|
+
copy: {
|
|
4554
|
+
EventType: "ClipboardEvent",
|
|
4555
|
+
defaultInit: {
|
|
4556
|
+
bubbles: true,
|
|
4557
|
+
cancelable: true,
|
|
4558
|
+
composed: true
|
|
4559
|
+
}
|
|
4560
|
+
},
|
|
4561
|
+
cut: {
|
|
4562
|
+
EventType: "ClipboardEvent",
|
|
4563
|
+
defaultInit: {
|
|
4564
|
+
bubbles: true,
|
|
4565
|
+
cancelable: true,
|
|
4566
|
+
composed: true
|
|
4567
|
+
}
|
|
4568
|
+
},
|
|
4569
|
+
paste: {
|
|
4570
|
+
EventType: "ClipboardEvent",
|
|
4571
|
+
defaultInit: {
|
|
4572
|
+
bubbles: true,
|
|
4573
|
+
cancelable: true,
|
|
4574
|
+
composed: true
|
|
4575
|
+
}
|
|
4576
|
+
},
|
|
4577
|
+
compositionEnd: {
|
|
4578
|
+
EventType: "CompositionEvent",
|
|
4579
|
+
defaultInit: {
|
|
4580
|
+
bubbles: true,
|
|
4581
|
+
cancelable: true,
|
|
4582
|
+
composed: true
|
|
4583
|
+
}
|
|
4584
|
+
},
|
|
4585
|
+
compositionStart: {
|
|
4586
|
+
EventType: "CompositionEvent",
|
|
4587
|
+
defaultInit: {
|
|
4588
|
+
bubbles: true,
|
|
4589
|
+
cancelable: true,
|
|
4590
|
+
composed: true
|
|
4591
|
+
}
|
|
4592
|
+
},
|
|
4593
|
+
compositionUpdate: {
|
|
4594
|
+
EventType: "CompositionEvent",
|
|
4595
|
+
defaultInit: {
|
|
4596
|
+
bubbles: true,
|
|
4597
|
+
cancelable: true,
|
|
4598
|
+
composed: true
|
|
4599
|
+
}
|
|
4600
|
+
},
|
|
4601
|
+
keyDown: {
|
|
4602
|
+
EventType: "KeyboardEvent",
|
|
4603
|
+
defaultInit: {
|
|
4604
|
+
bubbles: true,
|
|
4605
|
+
cancelable: true,
|
|
4606
|
+
charCode: 0,
|
|
4607
|
+
composed: true
|
|
4608
|
+
}
|
|
4609
|
+
},
|
|
4610
|
+
keyPress: {
|
|
4611
|
+
EventType: "KeyboardEvent",
|
|
4612
|
+
defaultInit: {
|
|
4613
|
+
bubbles: true,
|
|
4614
|
+
cancelable: true,
|
|
4615
|
+
charCode: 0,
|
|
4616
|
+
composed: true
|
|
4617
|
+
}
|
|
4618
|
+
},
|
|
4619
|
+
keyUp: {
|
|
4620
|
+
EventType: "KeyboardEvent",
|
|
4621
|
+
defaultInit: {
|
|
4622
|
+
bubbles: true,
|
|
4623
|
+
cancelable: true,
|
|
4624
|
+
charCode: 0,
|
|
4625
|
+
composed: true
|
|
4626
|
+
}
|
|
4627
|
+
},
|
|
4628
|
+
focus: {
|
|
4629
|
+
EventType: "FocusEvent",
|
|
4630
|
+
defaultInit: {
|
|
4631
|
+
bubbles: false,
|
|
4632
|
+
cancelable: false,
|
|
4633
|
+
composed: true
|
|
4634
|
+
}
|
|
4635
|
+
},
|
|
4636
|
+
blur: {
|
|
4637
|
+
EventType: "FocusEvent",
|
|
4638
|
+
defaultInit: {
|
|
4639
|
+
bubbles: false,
|
|
4640
|
+
cancelable: false,
|
|
4641
|
+
composed: true
|
|
4642
|
+
}
|
|
4643
|
+
},
|
|
4644
|
+
focusIn: {
|
|
4645
|
+
EventType: "FocusEvent",
|
|
4646
|
+
defaultInit: {
|
|
4647
|
+
bubbles: true,
|
|
4648
|
+
cancelable: false,
|
|
4649
|
+
composed: true
|
|
4650
|
+
}
|
|
4651
|
+
},
|
|
4652
|
+
focusOut: {
|
|
4653
|
+
EventType: "FocusEvent",
|
|
4654
|
+
defaultInit: {
|
|
4655
|
+
bubbles: true,
|
|
4656
|
+
cancelable: false,
|
|
4657
|
+
composed: true
|
|
4658
|
+
}
|
|
4659
|
+
},
|
|
4660
|
+
change: {
|
|
4661
|
+
EventType: "Event",
|
|
4662
|
+
defaultInit: {
|
|
4663
|
+
bubbles: true,
|
|
4664
|
+
cancelable: false
|
|
4665
|
+
}
|
|
4666
|
+
},
|
|
4667
|
+
input: {
|
|
4668
|
+
EventType: "InputEvent",
|
|
4669
|
+
defaultInit: {
|
|
4670
|
+
bubbles: true,
|
|
4671
|
+
cancelable: false,
|
|
4672
|
+
composed: true
|
|
4673
|
+
}
|
|
4674
|
+
},
|
|
4675
|
+
invalid: {
|
|
4676
|
+
EventType: "Event",
|
|
4677
|
+
defaultInit: {
|
|
4678
|
+
bubbles: false,
|
|
4679
|
+
cancelable: true
|
|
4680
|
+
}
|
|
4681
|
+
},
|
|
4682
|
+
submit: {
|
|
4683
|
+
EventType: "Event",
|
|
4684
|
+
defaultInit: {
|
|
4685
|
+
bubbles: true,
|
|
4686
|
+
cancelable: true
|
|
4687
|
+
}
|
|
4688
|
+
},
|
|
4689
|
+
reset: {
|
|
4690
|
+
EventType: "Event",
|
|
4691
|
+
defaultInit: {
|
|
4692
|
+
bubbles: true,
|
|
4693
|
+
cancelable: true
|
|
4694
|
+
}
|
|
4695
|
+
},
|
|
4696
|
+
click: {
|
|
4697
|
+
EventType: "MouseEvent",
|
|
4698
|
+
defaultInit: {
|
|
4699
|
+
bubbles: true,
|
|
4700
|
+
cancelable: true,
|
|
4701
|
+
button: 0,
|
|
4702
|
+
composed: true
|
|
4703
|
+
}
|
|
4704
|
+
},
|
|
4705
|
+
contextMenu: {
|
|
4706
|
+
EventType: "MouseEvent",
|
|
4707
|
+
defaultInit: {
|
|
4708
|
+
bubbles: true,
|
|
4709
|
+
cancelable: true,
|
|
4710
|
+
composed: true
|
|
4711
|
+
}
|
|
4712
|
+
},
|
|
4713
|
+
dblClick: {
|
|
4714
|
+
EventType: "MouseEvent",
|
|
4715
|
+
defaultInit: {
|
|
4716
|
+
bubbles: true,
|
|
4717
|
+
cancelable: true,
|
|
4718
|
+
composed: true
|
|
4719
|
+
}
|
|
4720
|
+
},
|
|
4721
|
+
drag: {
|
|
4722
|
+
EventType: "DragEvent",
|
|
4723
|
+
defaultInit: {
|
|
4724
|
+
bubbles: true,
|
|
4725
|
+
cancelable: true,
|
|
4726
|
+
composed: true
|
|
4727
|
+
}
|
|
4728
|
+
},
|
|
4729
|
+
dragEnd: {
|
|
4730
|
+
EventType: "DragEvent",
|
|
4731
|
+
defaultInit: {
|
|
4732
|
+
bubbles: true,
|
|
4733
|
+
cancelable: false,
|
|
4734
|
+
composed: true
|
|
4735
|
+
}
|
|
4736
|
+
},
|
|
4737
|
+
dragEnter: {
|
|
4738
|
+
EventType: "DragEvent",
|
|
4739
|
+
defaultInit: {
|
|
4740
|
+
bubbles: true,
|
|
4741
|
+
cancelable: true,
|
|
4742
|
+
composed: true
|
|
4743
|
+
}
|
|
4744
|
+
},
|
|
4745
|
+
dragExit: {
|
|
4746
|
+
EventType: "DragEvent",
|
|
4747
|
+
defaultInit: {
|
|
4748
|
+
bubbles: true,
|
|
4749
|
+
cancelable: false,
|
|
4750
|
+
composed: true
|
|
4751
|
+
}
|
|
4752
|
+
},
|
|
4753
|
+
dragLeave: {
|
|
4754
|
+
EventType: "DragEvent",
|
|
4755
|
+
defaultInit: {
|
|
4756
|
+
bubbles: true,
|
|
4757
|
+
cancelable: false,
|
|
4758
|
+
composed: true
|
|
4759
|
+
}
|
|
4760
|
+
},
|
|
4761
|
+
dragOver: {
|
|
4762
|
+
EventType: "DragEvent",
|
|
4763
|
+
defaultInit: {
|
|
4764
|
+
bubbles: true,
|
|
4765
|
+
cancelable: true,
|
|
4766
|
+
composed: true
|
|
4767
|
+
}
|
|
4768
|
+
},
|
|
4769
|
+
dragStart: {
|
|
4770
|
+
EventType: "DragEvent",
|
|
4771
|
+
defaultInit: {
|
|
4772
|
+
bubbles: true,
|
|
4773
|
+
cancelable: true,
|
|
4774
|
+
composed: true
|
|
4775
|
+
}
|
|
4776
|
+
},
|
|
4777
|
+
drop: {
|
|
4778
|
+
EventType: "DragEvent",
|
|
4779
|
+
defaultInit: {
|
|
4780
|
+
bubbles: true,
|
|
4781
|
+
cancelable: true,
|
|
4782
|
+
composed: true
|
|
4783
|
+
}
|
|
4784
|
+
},
|
|
4785
|
+
mouseDown: {
|
|
4786
|
+
EventType: "MouseEvent",
|
|
4787
|
+
defaultInit: {
|
|
4788
|
+
bubbles: true,
|
|
4789
|
+
cancelable: true,
|
|
4790
|
+
composed: true
|
|
4791
|
+
}
|
|
4792
|
+
},
|
|
4793
|
+
mouseEnter: {
|
|
4794
|
+
EventType: "MouseEvent",
|
|
4795
|
+
defaultInit: {
|
|
4796
|
+
bubbles: false,
|
|
4797
|
+
cancelable: false,
|
|
4798
|
+
composed: true
|
|
4799
|
+
}
|
|
4800
|
+
},
|
|
4801
|
+
mouseLeave: {
|
|
4802
|
+
EventType: "MouseEvent",
|
|
4803
|
+
defaultInit: {
|
|
4804
|
+
bubbles: false,
|
|
4805
|
+
cancelable: false,
|
|
4806
|
+
composed: true
|
|
4807
|
+
}
|
|
4808
|
+
},
|
|
4809
|
+
mouseMove: {
|
|
4810
|
+
EventType: "MouseEvent",
|
|
4811
|
+
defaultInit: {
|
|
4812
|
+
bubbles: true,
|
|
4813
|
+
cancelable: true,
|
|
4814
|
+
composed: true
|
|
4815
|
+
}
|
|
4816
|
+
},
|
|
4817
|
+
mouseOut: {
|
|
4818
|
+
EventType: "MouseEvent",
|
|
4819
|
+
defaultInit: {
|
|
4820
|
+
bubbles: true,
|
|
4821
|
+
cancelable: true,
|
|
4822
|
+
composed: true
|
|
4823
|
+
}
|
|
4824
|
+
},
|
|
4825
|
+
mouseOver: {
|
|
4826
|
+
EventType: "MouseEvent",
|
|
4827
|
+
defaultInit: {
|
|
4828
|
+
bubbles: true,
|
|
4829
|
+
cancelable: true,
|
|
4830
|
+
composed: true
|
|
4831
|
+
}
|
|
4832
|
+
},
|
|
4833
|
+
mouseUp: {
|
|
4834
|
+
EventType: "MouseEvent",
|
|
4835
|
+
defaultInit: {
|
|
4836
|
+
bubbles: true,
|
|
4837
|
+
cancelable: true,
|
|
4838
|
+
composed: true
|
|
4839
|
+
}
|
|
4840
|
+
},
|
|
4841
|
+
select: {
|
|
4842
|
+
EventType: "Event",
|
|
4843
|
+
defaultInit: {
|
|
4844
|
+
bubbles: true,
|
|
4845
|
+
cancelable: false
|
|
4846
|
+
}
|
|
4847
|
+
},
|
|
4848
|
+
touchCancel: {
|
|
4849
|
+
EventType: "TouchEvent",
|
|
4850
|
+
defaultInit: {
|
|
4851
|
+
bubbles: true,
|
|
4852
|
+
cancelable: false,
|
|
4853
|
+
composed: true
|
|
4854
|
+
}
|
|
4855
|
+
},
|
|
4856
|
+
touchEnd: {
|
|
4857
|
+
EventType: "TouchEvent",
|
|
4858
|
+
defaultInit: {
|
|
4859
|
+
bubbles: true,
|
|
4860
|
+
cancelable: true,
|
|
4861
|
+
composed: true
|
|
4862
|
+
}
|
|
4863
|
+
},
|
|
4864
|
+
touchMove: {
|
|
4865
|
+
EventType: "TouchEvent",
|
|
4866
|
+
defaultInit: {
|
|
4867
|
+
bubbles: true,
|
|
4868
|
+
cancelable: true,
|
|
4869
|
+
composed: true
|
|
4870
|
+
}
|
|
4871
|
+
},
|
|
4872
|
+
touchStart: {
|
|
4873
|
+
EventType: "TouchEvent",
|
|
4874
|
+
defaultInit: {
|
|
4875
|
+
bubbles: true,
|
|
4876
|
+
cancelable: true,
|
|
4877
|
+
composed: true
|
|
4878
|
+
}
|
|
4879
|
+
},
|
|
4880
|
+
resize: {
|
|
4881
|
+
EventType: "UIEvent",
|
|
4882
|
+
defaultInit: {
|
|
4883
|
+
bubbles: false,
|
|
4884
|
+
cancelable: false
|
|
4885
|
+
}
|
|
4886
|
+
},
|
|
4887
|
+
scroll: {
|
|
4888
|
+
EventType: "UIEvent",
|
|
4889
|
+
defaultInit: {
|
|
4890
|
+
bubbles: false,
|
|
4891
|
+
cancelable: false
|
|
4892
|
+
}
|
|
4893
|
+
},
|
|
4894
|
+
wheel: {
|
|
4895
|
+
EventType: "WheelEvent",
|
|
4896
|
+
defaultInit: {
|
|
4897
|
+
bubbles: true,
|
|
4898
|
+
cancelable: true,
|
|
4899
|
+
composed: true
|
|
4900
|
+
}
|
|
4901
|
+
},
|
|
4902
|
+
abort: {
|
|
4903
|
+
EventType: "Event",
|
|
4904
|
+
defaultInit: {
|
|
4905
|
+
bubbles: false,
|
|
4906
|
+
cancelable: false
|
|
4907
|
+
}
|
|
4908
|
+
},
|
|
4909
|
+
canPlay: {
|
|
4910
|
+
EventType: "Event",
|
|
4911
|
+
defaultInit: {
|
|
4912
|
+
bubbles: false,
|
|
4913
|
+
cancelable: false
|
|
4914
|
+
}
|
|
4915
|
+
},
|
|
4916
|
+
canPlayThrough: {
|
|
4917
|
+
EventType: "Event",
|
|
4918
|
+
defaultInit: {
|
|
4919
|
+
bubbles: false,
|
|
4920
|
+
cancelable: false
|
|
4921
|
+
}
|
|
4922
|
+
},
|
|
4923
|
+
durationChange: {
|
|
4924
|
+
EventType: "Event",
|
|
4925
|
+
defaultInit: {
|
|
4926
|
+
bubbles: false,
|
|
4927
|
+
cancelable: false
|
|
4928
|
+
}
|
|
4929
|
+
},
|
|
4930
|
+
emptied: {
|
|
4931
|
+
EventType: "Event",
|
|
4932
|
+
defaultInit: {
|
|
4933
|
+
bubbles: false,
|
|
4934
|
+
cancelable: false
|
|
4935
|
+
}
|
|
4936
|
+
},
|
|
4937
|
+
encrypted: {
|
|
4938
|
+
EventType: "Event",
|
|
4939
|
+
defaultInit: {
|
|
4940
|
+
bubbles: false,
|
|
4941
|
+
cancelable: false
|
|
4942
|
+
}
|
|
4943
|
+
},
|
|
4944
|
+
ended: {
|
|
4945
|
+
EventType: "Event",
|
|
4946
|
+
defaultInit: {
|
|
4947
|
+
bubbles: false,
|
|
4948
|
+
cancelable: false
|
|
4949
|
+
}
|
|
4950
|
+
},
|
|
4951
|
+
loadedData: {
|
|
4952
|
+
EventType: "Event",
|
|
4953
|
+
defaultInit: {
|
|
4954
|
+
bubbles: false,
|
|
4955
|
+
cancelable: false
|
|
4956
|
+
}
|
|
4957
|
+
},
|
|
4958
|
+
loadedMetadata: {
|
|
4959
|
+
EventType: "Event",
|
|
4960
|
+
defaultInit: {
|
|
4961
|
+
bubbles: false,
|
|
4962
|
+
cancelable: false
|
|
4963
|
+
}
|
|
4964
|
+
},
|
|
4965
|
+
loadStart: {
|
|
4966
|
+
EventType: "ProgressEvent",
|
|
4967
|
+
defaultInit: {
|
|
4968
|
+
bubbles: false,
|
|
4969
|
+
cancelable: false
|
|
4970
|
+
}
|
|
4971
|
+
},
|
|
4972
|
+
pause: {
|
|
4973
|
+
EventType: "Event",
|
|
4974
|
+
defaultInit: {
|
|
4975
|
+
bubbles: false,
|
|
4976
|
+
cancelable: false
|
|
4977
|
+
}
|
|
4978
|
+
},
|
|
4979
|
+
play: {
|
|
4980
|
+
EventType: "Event",
|
|
4981
|
+
defaultInit: {
|
|
4982
|
+
bubbles: false,
|
|
4983
|
+
cancelable: false
|
|
4984
|
+
}
|
|
4985
|
+
},
|
|
4986
|
+
playing: {
|
|
4987
|
+
EventType: "Event",
|
|
4988
|
+
defaultInit: {
|
|
4989
|
+
bubbles: false,
|
|
4990
|
+
cancelable: false
|
|
4991
|
+
}
|
|
4992
|
+
},
|
|
4993
|
+
progress: {
|
|
4994
|
+
EventType: "ProgressEvent",
|
|
4995
|
+
defaultInit: {
|
|
4996
|
+
bubbles: false,
|
|
4997
|
+
cancelable: false
|
|
4998
|
+
}
|
|
4999
|
+
},
|
|
5000
|
+
rateChange: {
|
|
5001
|
+
EventType: "Event",
|
|
5002
|
+
defaultInit: {
|
|
5003
|
+
bubbles: false,
|
|
5004
|
+
cancelable: false
|
|
5005
|
+
}
|
|
5006
|
+
},
|
|
5007
|
+
seeked: {
|
|
5008
|
+
EventType: "Event",
|
|
5009
|
+
defaultInit: {
|
|
5010
|
+
bubbles: false,
|
|
5011
|
+
cancelable: false
|
|
5012
|
+
}
|
|
5013
|
+
},
|
|
5014
|
+
seeking: {
|
|
5015
|
+
EventType: "Event",
|
|
5016
|
+
defaultInit: {
|
|
5017
|
+
bubbles: false,
|
|
5018
|
+
cancelable: false
|
|
5019
|
+
}
|
|
5020
|
+
},
|
|
5021
|
+
stalled: {
|
|
5022
|
+
EventType: "Event",
|
|
5023
|
+
defaultInit: {
|
|
5024
|
+
bubbles: false,
|
|
5025
|
+
cancelable: false
|
|
5026
|
+
}
|
|
5027
|
+
},
|
|
5028
|
+
suspend: {
|
|
5029
|
+
EventType: "Event",
|
|
5030
|
+
defaultInit: {
|
|
5031
|
+
bubbles: false,
|
|
5032
|
+
cancelable: false
|
|
5033
|
+
}
|
|
5034
|
+
},
|
|
5035
|
+
timeUpdate: {
|
|
5036
|
+
EventType: "Event",
|
|
5037
|
+
defaultInit: {
|
|
5038
|
+
bubbles: false,
|
|
5039
|
+
cancelable: false
|
|
5040
|
+
}
|
|
5041
|
+
},
|
|
5042
|
+
volumeChange: {
|
|
5043
|
+
EventType: "Event",
|
|
5044
|
+
defaultInit: {
|
|
5045
|
+
bubbles: false,
|
|
5046
|
+
cancelable: false
|
|
5047
|
+
}
|
|
5048
|
+
},
|
|
5049
|
+
waiting: {
|
|
5050
|
+
EventType: "Event",
|
|
5051
|
+
defaultInit: {
|
|
5052
|
+
bubbles: false,
|
|
5053
|
+
cancelable: false
|
|
5054
|
+
}
|
|
5055
|
+
},
|
|
5056
|
+
load: {
|
|
5057
|
+
EventType: "Event",
|
|
5058
|
+
defaultInit: {
|
|
5059
|
+
bubbles: false,
|
|
5060
|
+
cancelable: false
|
|
5061
|
+
}
|
|
5062
|
+
},
|
|
5063
|
+
error: {
|
|
5064
|
+
EventType: "Event",
|
|
5065
|
+
defaultInit: {
|
|
5066
|
+
bubbles: false,
|
|
5067
|
+
cancelable: false
|
|
5068
|
+
}
|
|
5069
|
+
},
|
|
5070
|
+
animationStart: {
|
|
5071
|
+
EventType: "AnimationEvent",
|
|
5072
|
+
defaultInit: {
|
|
5073
|
+
bubbles: true,
|
|
5074
|
+
cancelable: false
|
|
5075
|
+
}
|
|
5076
|
+
},
|
|
5077
|
+
animationEnd: {
|
|
5078
|
+
EventType: "AnimationEvent",
|
|
5079
|
+
defaultInit: {
|
|
5080
|
+
bubbles: true,
|
|
5081
|
+
cancelable: false
|
|
5082
|
+
}
|
|
5083
|
+
},
|
|
5084
|
+
animationIteration: {
|
|
5085
|
+
EventType: "AnimationEvent",
|
|
5086
|
+
defaultInit: {
|
|
5087
|
+
bubbles: true,
|
|
5088
|
+
cancelable: false
|
|
5089
|
+
}
|
|
5090
|
+
},
|
|
5091
|
+
transitionCancel: {
|
|
5092
|
+
EventType: "TransitionEvent",
|
|
5093
|
+
defaultInit: {
|
|
5094
|
+
bubbles: true,
|
|
5095
|
+
cancelable: false
|
|
5096
|
+
}
|
|
5097
|
+
},
|
|
5098
|
+
transitionEnd: {
|
|
5099
|
+
EventType: "TransitionEvent",
|
|
5100
|
+
defaultInit: {
|
|
5101
|
+
bubbles: true,
|
|
5102
|
+
cancelable: true
|
|
5103
|
+
}
|
|
5104
|
+
},
|
|
5105
|
+
transitionRun: {
|
|
5106
|
+
EventType: "TransitionEvent",
|
|
5107
|
+
defaultInit: {
|
|
5108
|
+
bubbles: true,
|
|
5109
|
+
cancelable: false
|
|
5110
|
+
}
|
|
5111
|
+
},
|
|
5112
|
+
transitionStart: {
|
|
5113
|
+
EventType: "TransitionEvent",
|
|
5114
|
+
defaultInit: {
|
|
5115
|
+
bubbles: true,
|
|
5116
|
+
cancelable: false
|
|
5117
|
+
}
|
|
5118
|
+
},
|
|
5119
|
+
pointerOver: {
|
|
5120
|
+
EventType: "PointerEvent",
|
|
5121
|
+
defaultInit: {
|
|
5122
|
+
bubbles: true,
|
|
5123
|
+
cancelable: true,
|
|
5124
|
+
composed: true
|
|
5125
|
+
}
|
|
5126
|
+
},
|
|
5127
|
+
pointerEnter: {
|
|
5128
|
+
EventType: "PointerEvent",
|
|
5129
|
+
defaultInit: {
|
|
5130
|
+
bubbles: false,
|
|
5131
|
+
cancelable: false
|
|
5132
|
+
}
|
|
5133
|
+
},
|
|
5134
|
+
pointerDown: {
|
|
5135
|
+
EventType: "PointerEvent",
|
|
5136
|
+
defaultInit: {
|
|
5137
|
+
bubbles: true,
|
|
5138
|
+
cancelable: true,
|
|
5139
|
+
composed: true
|
|
5140
|
+
}
|
|
5141
|
+
},
|
|
5142
|
+
pointerMove: {
|
|
5143
|
+
EventType: "PointerEvent",
|
|
5144
|
+
defaultInit: {
|
|
5145
|
+
bubbles: true,
|
|
5146
|
+
cancelable: true,
|
|
5147
|
+
composed: true
|
|
5148
|
+
}
|
|
5149
|
+
},
|
|
5150
|
+
pointerUp: {
|
|
5151
|
+
EventType: "PointerEvent",
|
|
5152
|
+
defaultInit: {
|
|
5153
|
+
bubbles: true,
|
|
5154
|
+
cancelable: true,
|
|
5155
|
+
composed: true
|
|
5156
|
+
}
|
|
5157
|
+
},
|
|
5158
|
+
pointerCancel: {
|
|
5159
|
+
EventType: "PointerEvent",
|
|
5160
|
+
defaultInit: {
|
|
5161
|
+
bubbles: true,
|
|
5162
|
+
cancelable: false,
|
|
5163
|
+
composed: true
|
|
5164
|
+
}
|
|
5165
|
+
},
|
|
5166
|
+
pointerOut: {
|
|
5167
|
+
EventType: "PointerEvent",
|
|
5168
|
+
defaultInit: {
|
|
5169
|
+
bubbles: true,
|
|
5170
|
+
cancelable: true,
|
|
5171
|
+
composed: true
|
|
5172
|
+
}
|
|
5173
|
+
},
|
|
5174
|
+
pointerLeave: {
|
|
5175
|
+
EventType: "PointerEvent",
|
|
5176
|
+
defaultInit: {
|
|
5177
|
+
bubbles: false,
|
|
5178
|
+
cancelable: false
|
|
5179
|
+
}
|
|
5180
|
+
},
|
|
5181
|
+
gotPointerCapture: {
|
|
5182
|
+
EventType: "PointerEvent",
|
|
5183
|
+
defaultInit: {
|
|
5184
|
+
bubbles: true,
|
|
5185
|
+
cancelable: false,
|
|
5186
|
+
composed: true
|
|
5187
|
+
}
|
|
5188
|
+
},
|
|
5189
|
+
lostPointerCapture: {
|
|
5190
|
+
EventType: "PointerEvent",
|
|
5191
|
+
defaultInit: {
|
|
5192
|
+
bubbles: true,
|
|
5193
|
+
cancelable: false,
|
|
5194
|
+
composed: true
|
|
5195
|
+
}
|
|
5196
|
+
},
|
|
5197
|
+
popState: {
|
|
5198
|
+
EventType: "PopStateEvent",
|
|
5199
|
+
defaultInit: {
|
|
5200
|
+
bubbles: true,
|
|
5201
|
+
cancelable: false
|
|
5202
|
+
}
|
|
5203
|
+
},
|
|
5204
|
+
offline: {
|
|
5205
|
+
EventType: "Event",
|
|
5206
|
+
defaultInit: {
|
|
5207
|
+
bubbles: false,
|
|
5208
|
+
cancelable: false
|
|
5209
|
+
}
|
|
5210
|
+
},
|
|
5211
|
+
online: {
|
|
5212
|
+
EventType: "Event",
|
|
5213
|
+
defaultInit: {
|
|
5214
|
+
bubbles: false,
|
|
5215
|
+
cancelable: false
|
|
5216
|
+
}
|
|
5217
|
+
},
|
|
5218
|
+
pageHide: {
|
|
5219
|
+
EventType: "PageTransitionEvent",
|
|
5220
|
+
defaultInit: {
|
|
5221
|
+
bubbles: true,
|
|
5222
|
+
cancelable: true
|
|
5223
|
+
}
|
|
5224
|
+
},
|
|
5225
|
+
pageShow: {
|
|
5226
|
+
EventType: "PageTransitionEvent",
|
|
5227
|
+
defaultInit: {
|
|
5228
|
+
bubbles: true,
|
|
5229
|
+
cancelable: true
|
|
5230
|
+
}
|
|
5231
|
+
}
|
|
5232
|
+
};
|
|
5233
|
+
eventAliasMap = { doubleClick: "dblClick" };
|
|
5234
|
+
_excluded = ["value", "files"];
|
|
5235
|
+
_excluded2 = [
|
|
5236
|
+
"bubbles",
|
|
5237
|
+
"cancelable",
|
|
5238
|
+
"detail"
|
|
5239
|
+
];
|
|
5240
|
+
Object.keys(eventMap$1).forEach((key) => {
|
|
5241
|
+
const _eventMap$key = eventMap$1[key], EventType = _eventMap$key.EventType, defaultInit = _eventMap$key.defaultInit;
|
|
5242
|
+
const eventName = key.toLowerCase();
|
|
5243
|
+
createEvent$1[key] = (node, init) => createEvent$1(eventName, node, init, {
|
|
5244
|
+
EventType,
|
|
5245
|
+
defaultInit
|
|
5246
|
+
});
|
|
5247
|
+
fireEvent[key] = (node, init) => fireEvent(node, createEvent$1[key](node, init));
|
|
5248
|
+
});
|
|
5249
|
+
Object.keys(eventAliasMap).forEach((aliasKey) => {
|
|
5250
|
+
const key = eventAliasMap[aliasKey];
|
|
5251
|
+
fireEvent[aliasKey] = function() {
|
|
5252
|
+
return fireEvent[key](...arguments);
|
|
5253
|
+
};
|
|
5254
|
+
});
|
|
5255
|
+
debug = (element, maxLength, options) => Array.isArray(element) ? element.forEach((el) => logDOM(el, maxLength, options)) : logDOM(element, maxLength, options);
|
|
5256
|
+
logTestingPlaygroundURL = function(element) {
|
|
5257
|
+
if (element === void 0) element = getDocument$1().body;
|
|
5258
|
+
if (!element || !("innerHTML" in element)) {
|
|
5259
|
+
console.log("The element you're providing isn't a valid DOM element.");
|
|
5260
|
+
return;
|
|
1929
5261
|
}
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
super();
|
|
1934
|
-
/* istanbul ignore next */
|
|
1935
|
-
if (Error.captureStackTrace) Error.captureStackTrace(this, matcherFn);
|
|
1936
|
-
this.message = [
|
|
1937
|
-
received.message,
|
|
1938
|
-
"",
|
|
1939
|
-
context.utils.RECEIVED_COLOR(`Failing css:`),
|
|
1940
|
-
context.utils.RECEIVED_COLOR(`${received.css}`)
|
|
1941
|
-
].join("\n");
|
|
5262
|
+
if (!element.innerHTML) {
|
|
5263
|
+
console.log("The provided element doesn't have any children.");
|
|
5264
|
+
return;
|
|
1942
5265
|
}
|
|
5266
|
+
const playgroundUrl = getPlaygroundUrl(element.innerHTML);
|
|
5267
|
+
console.log("Open this URL in your browser\n\n" + playgroundUrl);
|
|
5268
|
+
return playgroundUrl;
|
|
1943
5269
|
};
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
"slider",
|
|
1948
|
-
"spinbutton"
|
|
1949
|
-
];
|
|
1950
|
-
ariaInvalidName = "aria-invalid";
|
|
1951
|
-
validStates = ["false"];
|
|
1952
|
-
elementRoleList = buildElementRoleList(import_lib$1.elementRoles);
|
|
1953
|
-
FORM_TAGS$2 = [
|
|
1954
|
-
"fieldset",
|
|
1955
|
-
"input",
|
|
1956
|
-
"select",
|
|
1957
|
-
"optgroup",
|
|
1958
|
-
"option",
|
|
1959
|
-
"button",
|
|
1960
|
-
"textarea"
|
|
1961
|
-
];
|
|
1962
|
-
FORM_TAGS$1 = ["select", "textarea"];
|
|
1963
|
-
ARIA_FORM_TAGS = [
|
|
1964
|
-
"input",
|
|
1965
|
-
"select",
|
|
1966
|
-
"textarea"
|
|
1967
|
-
];
|
|
1968
|
-
UNSUPPORTED_INPUT_TYPES = [
|
|
1969
|
-
"color",
|
|
1970
|
-
"hidden",
|
|
1971
|
-
"range",
|
|
1972
|
-
"submit",
|
|
1973
|
-
"image",
|
|
1974
|
-
"reset"
|
|
1975
|
-
];
|
|
1976
|
-
SUPPORTED_ARIA_ROLES = [
|
|
1977
|
-
"checkbox",
|
|
1978
|
-
"combobox",
|
|
1979
|
-
"gridcell",
|
|
1980
|
-
"listbox",
|
|
1981
|
-
"radiogroup",
|
|
1982
|
-
"spinbutton",
|
|
1983
|
-
"textbox",
|
|
1984
|
-
"tree"
|
|
1985
|
-
];
|
|
1986
|
-
FORM_TAGS = [
|
|
1987
|
-
"form",
|
|
1988
|
-
"input",
|
|
1989
|
-
"select",
|
|
1990
|
-
"textarea"
|
|
1991
|
-
];
|
|
1992
|
-
DOCUMENT_POSITION_DISCONNECTED = 1;
|
|
1993
|
-
DOCUMENT_POSITION_PRECEDING = 2;
|
|
1994
|
-
DOCUMENT_POSITION_FOLLOWING = 4;
|
|
1995
|
-
DOCUMENT_POSITION_CONTAINS = 8;
|
|
1996
|
-
DOCUMENT_POSITION_CONTAINED_BY = 16;
|
|
1997
|
-
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
|
|
1998
|
-
DOCUMENT_POSITIONS_STRINGS = {
|
|
1999
|
-
[DOCUMENT_POSITION_DISCONNECTED]: "Node.DOCUMENT_POSITION_DISCONNECTED",
|
|
2000
|
-
[DOCUMENT_POSITION_PRECEDING]: "Node.DOCUMENT_POSITION_PRECEDING",
|
|
2001
|
-
[DOCUMENT_POSITION_FOLLOWING]: "Node.DOCUMENT_POSITION_FOLLOWING",
|
|
2002
|
-
[DOCUMENT_POSITION_CONTAINS]: "Node.DOCUMENT_POSITION_CONTAINS",
|
|
2003
|
-
[DOCUMENT_POSITION_CONTAINED_BY]: "Node.DOCUMENT_POSITION_CONTAINED_BY",
|
|
2004
|
-
[DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC]: "Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC"
|
|
5270
|
+
initialValue = {
|
|
5271
|
+
debug,
|
|
5272
|
+
logTestingPlaygroundURL
|
|
2005
5273
|
};
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
toAppearBefore: () => toAppearBefore,
|
|
2013
|
-
toBeChecked: () => toBeChecked,
|
|
2014
|
-
toBeDisabled: () => toBeDisabled,
|
|
2015
|
-
toBeEmpty: () => toBeEmpty,
|
|
2016
|
-
toBeEmptyDOMElement: () => toBeEmptyDOMElement,
|
|
2017
|
-
toBeEnabled: () => toBeEnabled,
|
|
2018
|
-
toBeInTheDOM: () => toBeInTheDOM,
|
|
2019
|
-
toBeInTheDocument: () => toBeInTheDocument,
|
|
2020
|
-
toBeInvalid: () => toBeInvalid,
|
|
2021
|
-
toBePartiallyChecked: () => toBePartiallyChecked,
|
|
2022
|
-
toBePartiallyPressed: () => toBePartiallyPressed,
|
|
2023
|
-
toBePressed: () => toBePressed,
|
|
2024
|
-
toBeRequired: () => toBeRequired,
|
|
2025
|
-
toBeValid: () => toBeValid,
|
|
2026
|
-
toBeVisible: () => toBeVisible,
|
|
2027
|
-
toContainElement: () => toContainElement,
|
|
2028
|
-
toContainHTML: () => toContainHTML,
|
|
2029
|
-
toHaveAccessibleDescription: () => toHaveAccessibleDescription,
|
|
2030
|
-
toHaveAccessibleErrorMessage: () => toHaveAccessibleErrorMessage,
|
|
2031
|
-
toHaveAccessibleName: () => toHaveAccessibleName,
|
|
2032
|
-
toHaveAttribute: () => toHaveAttribute,
|
|
2033
|
-
toHaveClass: () => toHaveClass,
|
|
2034
|
-
toHaveDescription: () => toHaveDescription,
|
|
2035
|
-
toHaveDisplayValue: () => toHaveDisplayValue,
|
|
2036
|
-
toHaveErrorMessage: () => toHaveErrorMessage,
|
|
2037
|
-
toHaveFocus: () => toHaveFocus,
|
|
2038
|
-
toHaveFormValues: () => toHaveFormValues,
|
|
2039
|
-
toHaveRole: () => toHaveRole,
|
|
2040
|
-
toHaveSelection: () => toHaveSelection,
|
|
2041
|
-
toHaveStyle: () => toHaveStyle,
|
|
2042
|
-
toHaveTextContent: () => toHaveTextContent,
|
|
2043
|
-
toHaveValue: () => toHaveValue
|
|
2044
|
-
});
|
|
2045
|
-
function init_matchers() {
|
|
2046
|
-
return (init_matchers = __esmMin((() => {
|
|
2047
|
-
init_matchers_35e4d3bd();
|
|
2048
|
-
require_redent();
|
|
2049
|
-
init_dist();
|
|
2050
|
-
require_lib();
|
|
2051
|
-
require_css_escape();
|
|
5274
|
+
screen = typeof document !== "undefined" && document.body ? getQueriesForElement(document.body, queries, initialValue) : Object.keys(queries).reduce((helpers, key) => {
|
|
5275
|
+
helpers[key] = () => {
|
|
5276
|
+
throw new TypeError("For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error");
|
|
5277
|
+
};
|
|
5278
|
+
return helpers;
|
|
5279
|
+
}, initialValue);
|
|
2052
5280
|
})))();
|
|
2053
5281
|
}
|
|
2054
5282
|
//#endregion
|
|
@@ -2115,6 +5343,13 @@ function _define_property$8(obj, key, value) {
|
|
|
2115
5343
|
else obj[key] = value;
|
|
2116
5344
|
return obj;
|
|
2117
5345
|
}
|
|
5346
|
+
function toAsciiLowercase(value) {
|
|
5347
|
+
return value.replace(/[A-Z]/g, (char) => char.toLowerCase());
|
|
5348
|
+
}
|
|
5349
|
+
function normalizeFormat(format) {
|
|
5350
|
+
const type = toAsciiLowercase(format);
|
|
5351
|
+
return type === "text" ? "text/plain" : type === "url" ? "text/uri-list" : type;
|
|
5352
|
+
}
|
|
2118
5353
|
function getTypeMatcher(type, exact) {
|
|
2119
5354
|
const [group, sub] = type.split("/");
|
|
2120
5355
|
const isGroup = !sub || sub === "*";
|
|
@@ -2126,7 +5361,8 @@ function createDataTransferStub(window) {
|
|
|
2126
5361
|
return new class DataTransferStub {
|
|
2127
5362
|
getData(format) {
|
|
2128
5363
|
var _this_items_find;
|
|
2129
|
-
const
|
|
5364
|
+
const type = normalizeFormat(format);
|
|
5365
|
+
const match = (_this_items_find = this.items.find(getTypeMatcher(type, true))) !== null && _this_items_find !== void 0 ? _this_items_find : this.items.find(getTypeMatcher(type, false));
|
|
2130
5366
|
let text = "";
|
|
2131
5367
|
match === null || match === void 0 || match.getAsString((t) => {
|
|
2132
5368
|
text = t;
|
|
@@ -2134,14 +5370,16 @@ function createDataTransferStub(window) {
|
|
|
2134
5370
|
return text;
|
|
2135
5371
|
}
|
|
2136
5372
|
setData(format, data) {
|
|
2137
|
-
const
|
|
2138
|
-
const
|
|
5373
|
+
const type = normalizeFormat(format);
|
|
5374
|
+
const matchIndex = this.items.findIndex(getTypeMatcher(type, true));
|
|
5375
|
+
const item = new DataTransferItemStub(data, type);
|
|
2139
5376
|
if (matchIndex >= 0) this.items.splice(matchIndex, 1, item);
|
|
2140
5377
|
else this.items.push(item);
|
|
2141
5378
|
}
|
|
2142
5379
|
clearData(format) {
|
|
2143
5380
|
if (format) {
|
|
2144
|
-
const
|
|
5381
|
+
const type = normalizeFormat(format);
|
|
5382
|
+
const matchIndex = this.items.findIndex(getTypeMatcher(type, true));
|
|
2145
5383
|
if (matchIndex >= 0) this.items.remove(matchIndex);
|
|
2146
5384
|
} else this.items.clear();
|
|
2147
5385
|
}
|
|
@@ -2201,7 +5439,7 @@ function init_DataTransfer() {
|
|
|
2201
5439
|
};
|
|
2202
5440
|
DataTransferItemListStub = class extends Array {
|
|
2203
5441
|
add(...args) {
|
|
2204
|
-
const item = new DataTransferItemStub(args[0], args[1]);
|
|
5442
|
+
const item = typeof args[0] === "string" ? new DataTransferItemStub(args[0], toAsciiLowercase(args[1])) : new DataTransferItemStub(args[0]);
|
|
2205
5443
|
this.push(item);
|
|
2206
5444
|
return item;
|
|
2207
5445
|
}
|
|
@@ -2401,6 +5639,9 @@ function getActiveElement(document) {
|
|
|
2401
5639
|
if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot) {
|
|
2402
5640
|
const activeElementInShadowTree = getActiveElement(activeElement.shadowRoot);
|
|
2403
5641
|
if (activeElementInShadowTree) return activeElementInShadowTree;
|
|
5642
|
+
} else if (activeElement && isElementType(activeElement, "iframe")) {
|
|
5643
|
+
const contentDocument = activeElement.contentDocument;
|
|
5644
|
+
if (contentDocument) return getActiveElement(contentDocument);
|
|
2404
5645
|
}
|
|
2405
5646
|
if (isDisabled(activeElement)) return document.ownerDocument ? /* istanbul ignore next */ document.ownerDocument.body : document.body;
|
|
2406
5647
|
return activeElement;
|
|
@@ -2676,8 +5917,8 @@ function init_UI() {
|
|
|
2676
5917
|
function buildTimeValue(value) {
|
|
2677
5918
|
const onlyDigitsValue = value.replace(/\D/g, "");
|
|
2678
5919
|
if (onlyDigitsValue.length < 2) return value;
|
|
2679
|
-
const firstDigit = parseInt(onlyDigitsValue[0], 10);
|
|
2680
|
-
const secondDigit = parseInt(onlyDigitsValue[1], 10);
|
|
5920
|
+
const firstDigit = parseInt$1(onlyDigitsValue[0], 10);
|
|
5921
|
+
const secondDigit = parseInt$1(onlyDigitsValue[1], 10);
|
|
2681
5922
|
if (firstDigit >= 3 || firstDigit === 2 && secondDigit >= 4) {
|
|
2682
5923
|
let index;
|
|
2683
5924
|
if (firstDigit >= 3) index = 1;
|
|
@@ -2689,9 +5930,9 @@ function buildTimeValue(value) {
|
|
|
2689
5930
|
}
|
|
2690
5931
|
function build(onlyDigitsValue, index) {
|
|
2691
5932
|
const hours = onlyDigitsValue.slice(0, index);
|
|
2692
|
-
const validHours = Math.min(parseInt(hours, 10), 23);
|
|
5933
|
+
const validHours = Math.min(parseInt$1(hours, 10), 23);
|
|
2693
5934
|
const minuteCharacters = onlyDigitsValue.slice(index);
|
|
2694
|
-
const parsedMinutes = parseInt(minuteCharacters, 10);
|
|
5935
|
+
const parsedMinutes = parseInt$1(minuteCharacters, 10);
|
|
2695
5936
|
const validMinutes = Math.min(parsedMinutes, 59);
|
|
2696
5937
|
return `${validHours.toString().padStart(2, "0")}:${validMinutes.toString().padStart(2, "0")}`;
|
|
2697
5938
|
}
|
|
@@ -2700,10 +5941,10 @@ function isValidDateOrTimeValue(element, value) {
|
|
|
2700
5941
|
clone.value = value;
|
|
2701
5942
|
return clone.value === value;
|
|
2702
5943
|
}
|
|
2703
|
-
var parseInt;
|
|
5944
|
+
var parseInt$1;
|
|
2704
5945
|
function init_timeValue() {
|
|
2705
5946
|
return (init_timeValue = __esmMin((() => {
|
|
2706
|
-
parseInt = globalThis.parseInt;
|
|
5947
|
+
parseInt$1 = globalThis.parseInt;
|
|
2707
5948
|
})))();
|
|
2708
5949
|
}
|
|
2709
5950
|
//#endregion
|
|
@@ -3248,6 +6489,7 @@ function init_keydown() {
|
|
|
3248
6489
|
init_getValueOrTextContent();
|
|
3249
6490
|
init_Clipboard();
|
|
3250
6491
|
init_isEditable();
|
|
6492
|
+
init_getActiveElement();
|
|
3251
6493
|
init_getTabDestination();
|
|
3252
6494
|
init_selection();
|
|
3253
6495
|
init_focus();
|
|
@@ -3313,7 +6555,7 @@ function init_keydown() {
|
|
|
3313
6555
|
},
|
|
3314
6556
|
Tab: (event, target, instance) => {
|
|
3315
6557
|
return () => {
|
|
3316
|
-
const dest = getTabDestination(
|
|
6558
|
+
const dest = getTabDestination(getActiveElementOrBody(instance.config.document), instance.system.keyboard.modifiers.Shift);
|
|
3317
6559
|
focusElement(dest);
|
|
3318
6560
|
if (hasOwnSelection(dest)) setUISelection(dest, {
|
|
3319
6561
|
anchorOffset: 0,
|
|
@@ -3694,12 +6936,7 @@ function createEvent(type, target, init) {
|
|
|
3694
6936
|
const window = getWindow(target);
|
|
3695
6937
|
const { EventType, defaultInit } = eventMap[type];
|
|
3696
6938
|
const event = new (getEventConstructors(window))[EventType](type, defaultInit);
|
|
3697
|
-
|
|
3698
|
-
for (var key in init) if (Object.prototype.hasOwnProperty.call(init, key)) eventInit[key] = init[key];
|
|
3699
|
-
eventInit.view = window;
|
|
3700
|
-
eventInitializer[EventType].forEach(function(f) {
|
|
3701
|
-
f(event, eventInit);
|
|
3702
|
-
});
|
|
6939
|
+
eventInitializer[EventType].forEach((f) => f(event, init !== null && init !== void 0 ? init : {}));
|
|
3703
6940
|
return event;
|
|
3704
6941
|
}
|
|
3705
6942
|
/* istanbul ignore next */ function getEventConstructors(window) {
|
|
@@ -3820,7 +7057,7 @@ function initPointerEvent(event, { pointerId, width, height, pressure, tangentia
|
|
|
3820
7057
|
tiltX: sanitizeNumber(tiltX),
|
|
3821
7058
|
tiltY: sanitizeNumber(tiltY),
|
|
3822
7059
|
twist: sanitizeNumber(twist),
|
|
3823
|
-
pointerType: String(pointerType),
|
|
7060
|
+
pointerType: String(pointerType !== null && pointerType !== void 0 ? pointerType : ""),
|
|
3824
7061
|
isPrimary: Boolean(isPrimary)
|
|
3825
7062
|
});
|
|
3826
7063
|
}
|
|
@@ -3973,7 +7210,8 @@ function prepareInterceptor(element, propName, interceptorImpl) {
|
|
|
3973
7210
|
/* istanbul ignore if */ if (typeof (prototypeDescriptor === null || prototypeDescriptor === void 0 ? void 0 : prototypeDescriptor[target]) !== "function" || prototypeDescriptor[target][Interceptor]) throw new Error(`Element ${element.tagName} does not implement "${String(propName)}".`);
|
|
3974
7211
|
function intercept(...args) {
|
|
3975
7212
|
const { applyNative = false, realArgs, then } = interceptorImpl.call(this, ...args);
|
|
3976
|
-
const
|
|
7213
|
+
const sourceDescriptor = !applyNative && objectDescriptor ? objectDescriptor : prototypeDescriptor;
|
|
7214
|
+
const realFunc = sourceDescriptor === null || sourceDescriptor === void 0 ? void 0 : sourceDescriptor[target];
|
|
3977
7215
|
if (target === "set") realFunc.call(this, realArgs);
|
|
3978
7216
|
else realFunc.call(this, ...realArgs);
|
|
3979
7217
|
then === null || then === void 0 || then();
|
|
@@ -3986,12 +7224,13 @@ function prepareInterceptor(element, propName, interceptorImpl) {
|
|
|
3986
7224
|
}
|
|
3987
7225
|
function prepareValueInterceptor(element) {
|
|
3988
7226
|
prepareInterceptor(element, "value", function interceptorImpl(v) {
|
|
3989
|
-
const
|
|
7227
|
+
const value = v === null ? "" : v;
|
|
7228
|
+
const isUI = isUIValue(value);
|
|
3990
7229
|
if (isUI) startTrackValue(this);
|
|
3991
7230
|
return {
|
|
3992
7231
|
applyNative: !!isUI,
|
|
3993
|
-
realArgs: sanitizeValue(this,
|
|
3994
|
-
then: isUI ? void 0 : () => trackOrSetValue(this, String(
|
|
7232
|
+
realArgs: sanitizeValue(this, value),
|
|
7233
|
+
then: isUI ? void 0 : () => trackOrSetValue(this, String(value))
|
|
3995
7234
|
};
|
|
3996
7235
|
});
|
|
3997
7236
|
}
|
|
@@ -4199,7 +7438,7 @@ function init_keyboard() {
|
|
|
4199
7438
|
getPressedKeys() {
|
|
4200
7439
|
return this.pressed.values().map((p) => p.keyDef);
|
|
4201
7440
|
}
|
|
4202
|
-
/** Press a key */ async keydown(instance, keyDef) {
|
|
7441
|
+
/** Press a key */ async keydown(instance, keyDef, repeat = false) {
|
|
4203
7442
|
const key = String(keyDef.key);
|
|
4204
7443
|
const code = String(keyDef.code);
|
|
4205
7444
|
const target = getActiveElementOrBody(instance.config.document);
|
|
@@ -4208,7 +7447,8 @@ function init_keyboard() {
|
|
|
4208
7447
|
if (isModifierKey(key)) this.modifiers[key] = true;
|
|
4209
7448
|
const unprevented = instance.dispatchUIEvent(target, "keydown", {
|
|
4210
7449
|
key,
|
|
4211
|
-
code
|
|
7450
|
+
code,
|
|
7451
|
+
repeat
|
|
4212
7452
|
});
|
|
4213
7453
|
if (isModifierLock(key) && !this.modifiers[key]) {
|
|
4214
7454
|
this.modifiers[key] = true;
|
|
@@ -5478,7 +8718,7 @@ async function keyboardAction(instance, { keyDef, releasePrevious, releaseSelf,
|
|
|
5478
8718
|
if (system.keyboard.isKeyPressed(keyDef)) await system.keyboard.keyup(instance, keyDef);
|
|
5479
8719
|
if (!releasePrevious) {
|
|
5480
8720
|
for (let i = 1; i <= repeat; i++) {
|
|
5481
|
-
await system.keyboard.keydown(instance, keyDef);
|
|
8721
|
+
await system.keyboard.keydown(instance, keyDef, i > 1);
|
|
5482
8722
|
if (i < repeat) await wait(instance.config);
|
|
5483
8723
|
}
|
|
5484
8724
|
if (releaseSelf) await system.keyboard.keyup(instance, keyDef);
|
|
@@ -6140,4 +9380,4 @@ function init_esm() {
|
|
|
6140
9380
|
})))();
|
|
6141
9381
|
}
|
|
6142
9382
|
//#endregion
|
|
6143
|
-
export {
|
|
9383
|
+
export { init_dom_esm as a, dom_esm_exports as i, init_setup$1 as n, init_matchers as o, userEvent as r, matchers_exports as s, init_esm as t };
|