@northern.tech/testing 0.13.0 → 0.13.1

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.
Files changed (71) hide show
  1. package/dist/mockData.cjs +6 -12
  2. package/dist/mockData.cjs.map +1 -1
  3. package/dist/mockData.d.cts +11 -18
  4. package/dist/mockData.d.ts +11 -18
  5. package/dist/mockData.js +6 -11
  6. package/dist/mockData.js.map +1 -1
  7. package/dist/requestHandlers/deploymentHandlers.cjs +1 -2
  8. package/dist/requestHandlers/deploymentHandlers.cjs.map +1 -1
  9. package/dist/requestHandlers/deploymentHandlers.d.cts +1 -3
  10. package/dist/requestHandlers/deploymentHandlers.d.ts +1 -3
  11. package/dist/requestHandlers/deploymentHandlers.js +1 -1
  12. package/dist/requestHandlers/deploymentHandlers.js.map +1 -1
  13. package/dist/requestHandlers/deviceHandlers.cjs +1 -2
  14. package/dist/requestHandlers/deviceHandlers.cjs.map +1 -1
  15. package/dist/requestHandlers/deviceHandlers.d.cts +1 -3
  16. package/dist/requestHandlers/deviceHandlers.d.ts +1 -3
  17. package/dist/requestHandlers/deviceHandlers.js +1 -1
  18. package/dist/requestHandlers/deviceHandlers.js.map +1 -1
  19. package/dist/requestHandlers/monitorHandlers.cjs +1 -2
  20. package/dist/requestHandlers/monitorHandlers.cjs.map +1 -1
  21. package/dist/requestHandlers/monitorHandlers.d.cts +1 -3
  22. package/dist/requestHandlers/monitorHandlers.d.ts +1 -3
  23. package/dist/requestHandlers/monitorHandlers.js +1 -1
  24. package/dist/requestHandlers/monitorHandlers.js.map +1 -1
  25. package/dist/requestHandlers/organizationHandlers.cjs +1 -2
  26. package/dist/requestHandlers/organizationHandlers.cjs.map +1 -1
  27. package/dist/requestHandlers/organizationHandlers.d.cts +1 -3
  28. package/dist/requestHandlers/organizationHandlers.d.ts +1 -3
  29. package/dist/requestHandlers/organizationHandlers.js +1 -1
  30. package/dist/requestHandlers/organizationHandlers.js.map +1 -1
  31. package/dist/requestHandlers/releaseHandlers.cjs +7 -2
  32. package/dist/requestHandlers/releaseHandlers.cjs.map +1 -1
  33. package/dist/requestHandlers/releaseHandlers.d.cts +1 -3
  34. package/dist/requestHandlers/releaseHandlers.d.ts +1 -3
  35. package/dist/requestHandlers/releaseHandlers.js +7 -1
  36. package/dist/requestHandlers/releaseHandlers.js.map +1 -1
  37. package/dist/requestHandlers/requestHandlers.cjs +0 -1
  38. package/dist/requestHandlers/requestHandlers.cjs.map +1 -1
  39. package/dist/requestHandlers/requestHandlers.d.cts +1 -3
  40. package/dist/requestHandlers/requestHandlers.d.ts +1 -3
  41. package/dist/requestHandlers/requestHandlers.js.map +1 -1
  42. package/dist/requestHandlers/userHandlers.cjs +1 -2
  43. package/dist/requestHandlers/userHandlers.cjs.map +1 -1
  44. package/dist/requestHandlers/userHandlers.d.cts +1 -3
  45. package/dist/requestHandlers/userHandlers.d.ts +1 -3
  46. package/dist/requestHandlers/userHandlers.js +1 -1
  47. package/dist/requestHandlers/userHandlers.js.map +1 -1
  48. package/dist/requestHandlers/validation.cjs +1 -1
  49. package/dist/requestHandlers/validation.js +1 -1
  50. package/dist/setupTests.cjs +2 -3
  51. package/dist/setupTests.cjs.map +1 -1
  52. package/dist/setupTests.d.cts +49 -52
  53. package/dist/setupTests.d.ts +49 -52
  54. package/dist/setupTests.js +1 -1
  55. package/dist/setupTests.js.map +1 -1
  56. package/dist/theme/light.cjs.map +1 -1
  57. package/dist/theme/light.js.map +1 -1
  58. package/dist/utils.cjs +0 -1
  59. package/dist/utils.cjs.map +1 -1
  60. package/dist/utils.d.cts +1 -3
  61. package/dist/utils.d.ts +1 -3
  62. package/dist/utils.js.map +1 -1
  63. package/dist/validation-caoivLBj.js +64 -0
  64. package/dist/validation-caoivLBj.js.map +1 -0
  65. package/dist/validation-sI3hdTHq.cjs +75 -0
  66. package/dist/validation-sI3hdTHq.cjs.map +1 -0
  67. package/package.json +3 -3
  68. package/dist/validation-BhqZNZ-s.js +0 -64
  69. package/dist/validation-BhqZNZ-s.js.map +0 -1
  70. package/dist/validation-ofsPAnds.cjs +0 -76
  71. package/dist/validation-ofsPAnds.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"userHandlers.js","names":["defaultUserId","userId"],"sources":["../../src/requestHandlers/userHandlers.ts"],"sourcesContent":["// Copyright 2020 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport { APPLICATION_JWT_CONTENT_TYPE, useradmApiUrl, useradmApiUrlv2 } from '@northern.tech/utils/constants';\nimport { HttpResponse, http } from 'msw';\n\nimport { accessTokens, defaultPassword, userId as defaultUserId, mockApiResponses, permissionSets, rbacRoles, testSsoId, token } from '../mockData';\nimport { validated } from './validation';\n\nexport const userHandlers = [\n http.post(`${useradmApiUrl}/auth/login`, ({ request }) => {\n const authHeader = request.headers.get('authorization');\n const authInfo = atob(authHeader?.split(' ')[1]);\n const [user, password] = authInfo.split(':');\n\n if (!password) {\n return HttpResponse.json({ id: testSsoId, kind: 'sso/saml' });\n } else if (password !== defaultPassword) {\n return new HttpResponse(null, { status: 401 });\n } else if (user.includes('limited')) {\n return new HttpResponse('limitedToken', { headers: { 'Content-Type': APPLICATION_JWT_CONTENT_TYPE } });\n } else if (user.includes('2fa')) {\n return new HttpResponse(JSON.stringify({ error: '2fa needed' }), { status: 401 });\n }\n\n return new HttpResponse(token, { headers: { 'Content-Type': APPLICATION_JWT_CONTENT_TYPE } });\n }),\n http.get(`https://hosted.mender.io${useradmApiUrl}/auth/magic/:id`, ({ params: { id } }) => {\n if (id) {\n return new HttpResponse('test', { headers: { 'Set-Cookie': 'JWT=test' } });\n }\n return new HttpResponse(null, { status: 400 });\n }),\n http.post(`${useradmApiUrl}/auth/logout`, () => new HttpResponse(null, { status: 200 })),\n http.post(\n `${useradmApiUrl}/auth/password-reset/:status`,\n validated(async ({ params: { status }, request }) => {\n const { email, secret_hash, password } = await request.json();\n if (!['start', 'complete'].includes(status) && ![email, secret_hash, password].some(item => item)) {\n return new HttpResponse(null, { status: 560 });\n }\n if (status === 'start' && email) {\n return new HttpResponse(null, { status: 200 });\n }\n if (status === 'complete' && secret_hash && password) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 561 });\n })\n ),\n http.put(\n `${useradmApiUrl}/2faverify`,\n validated(async ({ request }) => {\n const { token2fa } = await request.json();\n if (!token2fa) {\n return new HttpResponse(null, { status: 562 });\n }\n return new HttpResponse(null, { status: 200 });\n })\n ),\n http.get(`${useradmApiUrl}/users`, () => HttpResponse.json(Object.values(mockApiResponses.users.byId))),\n http.get(`${useradmApiUrl}/users/me`, ({ request }) => {\n const authHeader = request.headers.get('authorization');\n if (authHeader?.includes('limited')) {\n return new HttpResponse(JSON.stringify({ error: 'forbidden by role-based access control' }), { status: 403 });\n }\n return HttpResponse.json(mockApiResponses.users.byId[defaultUserId]);\n }),\n http.get(`${useradmApiUrl}/users/exists`, ({ request }) => {\n const url = new URL(request.url);\n const email = url.searchParams.get('email');\n if (!decodeURIComponent(email).includes('child+123')) {\n return new HttpResponse(null, { status: 578 });\n }\n return HttpResponse.json({ exists: true });\n }),\n http.get(`${useradmApiUrl}/users/:userId`, ({ params: { userId } }) => {\n if (userId === 'me' || mockApiResponses.users.byId[userId]) {\n const user = userId === 'me' ? defaultUserId : userId;\n return HttpResponse.json(mockApiResponses.users.byId[user]);\n }\n return new HttpResponse(null, { status: 563 });\n }),\n http.post(\n `${useradmApiUrl}/users`,\n validated(async ({ request }) => {\n const { email, password } = await request.json();\n if (email === 'test@test.com' || [email, password].every(value => value)) {\n return HttpResponse.json(mockApiResponses.users.byId.a1);\n }\n return new HttpResponse(null, { status: 564 });\n })\n ),\n http.put(\n `${useradmApiUrl}/users/:userId`,\n validated(async ({ params: { userId }, request }) => {\n const { email, password, current_password } = await request.json();\n if (current_password === 'bad_password') {\n return new HttpResponse(null, { status: 401 });\n }\n if (\n (mockApiResponses.users.byId[userId] && [email, password].some(value => Object.values(mockApiResponses.users.byId[userId]).includes(value))) ||\n email === 'test@test.com'\n ) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 565 });\n })\n ),\n http.delete(\n `${useradmApiUrl}/users/:userId`,\n ({ params: { userId } }) => new HttpResponse(null, { status: mockApiResponses.users.byId[userId] ? 200 : 566 })\n ),\n http.get(`${useradmApiUrl}/roles`, () => HttpResponse.json(rbacRoles)),\n http.post(\n `${useradmApiUrl}/roles`,\n validated(async ({ request }) => {\n const { name, permissions } = await request.json();\n if (\n [name, permissions].every(value => value) &&\n permissions.every(permission => permission.action && permission.object && permission.object.type && permission.object.value)\n ) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 567 });\n })\n ),\n http.put(\n `${useradmApiUrl}/roles/:roleId`,\n validated(async ({ params: { roleId }, request }) => {\n const { description, name, permissions } = await request.json();\n if (mockApiResponses.users.rolesById[roleId] && [description, name, permissions].some(value => value)) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 568 });\n })\n ),\n http.post(`${useradmApiUrlv2}/support/feedback/product`, async () => new HttpResponse(null, { status: 200 })),\n http.delete(\n `${useradmApiUrl}/roles/:roleId`,\n ({ params: { roleId } }) => new HttpResponse(null, { status: mockApiResponses.users.rolesById[roleId] ? 200 : 569 })\n ),\n http.get(`${useradmApiUrlv2}/roles`, () => HttpResponse.json(rbacRoles)),\n http.get(`${useradmApiUrlv2}/roles/:roleId`, async ({ params: { roleId } }) => {\n if (mockApiResponses.users.rolesById[roleId]) {\n return HttpResponse.json(mockApiResponses.users.rolesById[roleId]);\n }\n return new HttpResponse(null, { status: 571 });\n }),\n http.post(\n `${useradmApiUrlv2}/roles`,\n validated(async ({ request }) => {\n const { name, permission_sets_with_scope } = await request.json();\n if (\n !!name &&\n permission_sets_with_scope.every(permission => permission.name && permissionSets.find(permissionSet => permissionSet.name === permission.name))\n ) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 572 });\n })\n ),\n http.put(\n `${useradmApiUrlv2}/roles/:roleId`,\n validated(async ({ params: { roleId }, request }) => {\n const { description, name, permission_sets_with_scope } = await request.json();\n if (mockApiResponses.users.rolesById[roleId] && [description, name, permission_sets_with_scope].some(value => value)) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 573 });\n })\n ),\n http.delete(`${useradmApiUrlv2}/roles/:roleId`, ({ params: { roleId } }) => {\n if (mockApiResponses.users.rolesById[roleId]) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 574 });\n }),\n http.get(`${useradmApiUrl}/settings`, () => HttpResponse.json(mockApiResponses.users.globalSettings)),\n http.post(`${useradmApiUrl}/settings`, () => new HttpResponse(null, { status: 200 })),\n http.get(`${useradmApiUrl}/settings/me`, () => HttpResponse.json(mockApiResponses.users.userSettings)),\n http.post(`${useradmApiUrl}/settings/me`, () => new HttpResponse(null, { status: 200 })),\n http.get(`${useradmApiUrl}/settings/tokens`, () => HttpResponse.json(accessTokens)),\n http.post(`${useradmApiUrl}/settings/tokens`, () => HttpResponse.json('aNewToken')),\n http.delete(\n `${useradmApiUrl}/settings/tokens/:tokenId`,\n ({ params: { tokenId } }) => new HttpResponse(null, { status: tokenId === 'some-id-1' ? 200 : 577 })\n ),\n http.get(`${useradmApiUrl}/2faqr`, () => HttpResponse.json({ qr: btoa('test') })),\n http.post(`${useradmApiUrl}/users/:userId/2fa/enable`, ({ params: { userId } }) => {\n if (mockApiResponses.users.byId[userId] || userId === 'me') {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 570 });\n }),\n http.post(`${useradmApiUrl}/users/:userId/2fa/disable`, ({ params: { userId } }) => {\n if (mockApiResponses.users.byId[userId] || userId === 'me') {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 571 });\n }),\n http.post(`${useradmApiUrl}/auth/verify-email/start`, () => new HttpResponse(null, { status: 200 })),\n http.post(\n `${useradmApiUrl}/auth/verify-email/complete`,\n validated(async ({ request }) => {\n const { secret_hash } = await request.json();\n return new HttpResponse(null, { status: secret_hash === 'superSecret' ? 200 : 576 });\n })\n ),\n http.get(`${useradmApiUrlv2}/permission_sets`, () => HttpResponse.json(permissionSets)),\n http.post(\n `${useradmApiUrl}/users/:userId/assign`,\n validated(async ({ request }) => {\n const { tenant_ids } = await request.json();\n return new HttpResponse(null, { status: tenant_ids.length ? 200 : 577 });\n })\n ),\n http.get(`${useradmApiUrl}/users/tenants/:tenantId/token`, () => HttpResponse.text('differentToken')),\n http.post(`${useradmApiUrl}/oauth2/link`, ({ request }) => {\n const authHeader = request.headers.get('authorization');\n const authInfo = atob(authHeader?.split(' ')[1]);\n const [user, password] = authInfo.split(':');\n\n if (password !== defaultPassword) {\n return new HttpResponse(null, { status: 401 });\n } else if (user.includes('2fa')) {\n return new HttpResponse(JSON.stringify({ error: '2fa needed' }), { status: 401 });\n }\n\n return new HttpResponse(token, { headers: { 'Content-Type': APPLICATION_JWT_CONTENT_TYPE } });\n })\n];\n"],"mappings":";;;;;AAoBA,MAAa,eAAe;CAC1B,KAAK,KAAK,GAAG,cAAc,eAAe,EAAE,cAAc;EACxD,MAAM,aAAa,QAAQ,QAAQ,IAAI,gBAAgB;EAEvD,MAAM,CAAC,MAAM,YADI,KAAK,YAAY,MAAM,IAAI,CAAC,GACZ,CAAC,MAAM,IAAI;EAE5C,IAAI,CAAC,UACH,OAAO,aAAa,KAAK;GAAE,IAAI;GAAW,MAAM;GAAY,CAAC;OACxD,IAAI,aAAA,wBACT,OAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,KAAK,CAAC;OACzC,IAAI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wBACF,OAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,KAAK,CAAC;OACzC,IAAI,KAAK,SAAS,MAAM,EAC7B,OAAO,IAAI,aAAa,KAAK,UAAU,EAAE,OAAO,cAAc,CAAC,EAAE,EAAE,QAAQ,KAAK,CAAC;EAGnF,OAAO,IAAI,aAAa,OAAO,EAAE,SAAS,EAAE,gBAAgB,8BAA8B,EAAE,CAAC;GAC7F;CACH"}
1
+ {"version":3,"file":"userHandlers.js","names":["defaultUserId","userId"],"sources":["../../src/requestHandlers/userHandlers.ts"],"sourcesContent":["// Copyright 2020 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport { APPLICATION_JWT_CONTENT_TYPE, useradmApiUrl, useradmApiUrlv2 } from '@northern.tech/utils/constants';\nimport { HttpResponse, http } from 'msw';\n\nimport { accessTokens, defaultPassword, userId as defaultUserId, mockApiResponses, permissionSets, rbacRoles, testSsoId, token } from '../mockData';\nimport { validated } from './validation';\n\nexport const userHandlers = [\n http.post(`${useradmApiUrl}/auth/login`, ({ request }) => {\n const authHeader = request.headers.get('authorization');\n const authInfo = atob(authHeader?.split(' ')[1]);\n const [user, password] = authInfo.split(':');\n\n if (!password) {\n return HttpResponse.json({ id: testSsoId, kind: 'sso/saml' });\n } else if (password !== defaultPassword) {\n return new HttpResponse(null, { status: 401 });\n } else if (user.includes('limited')) {\n return new HttpResponse('limitedToken', { headers: { 'Content-Type': APPLICATION_JWT_CONTENT_TYPE } });\n } else if (user.includes('2fa')) {\n return new HttpResponse(JSON.stringify({ error: '2fa needed' }), { status: 401 });\n }\n\n return new HttpResponse(token, { headers: { 'Content-Type': APPLICATION_JWT_CONTENT_TYPE } });\n }),\n http.get(`https://hosted.mender.io${useradmApiUrl}/auth/magic/:id`, ({ params: { id } }) => {\n if (id) {\n return new HttpResponse('test', { headers: { 'Set-Cookie': 'JWT=test' } });\n }\n return new HttpResponse(null, { status: 400 });\n }),\n http.post(`${useradmApiUrl}/auth/logout`, () => new HttpResponse(null, { status: 200 })),\n http.post(\n `${useradmApiUrl}/auth/password-reset/:status`,\n validated(async ({ params: { status }, request }) => {\n const { email, secret_hash, password } = await request.json();\n if (!['start', 'complete'].includes(status) && ![email, secret_hash, password].some(item => item)) {\n return new HttpResponse(null, { status: 560 });\n }\n if (status === 'start' && email) {\n return new HttpResponse(null, { status: 200 });\n }\n if (status === 'complete' && secret_hash && password) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 561 });\n })\n ),\n http.put(\n `${useradmApiUrl}/2faverify`,\n validated(async ({ request }) => {\n const { token2fa } = await request.json();\n if (!token2fa) {\n return new HttpResponse(null, { status: 562 });\n }\n return new HttpResponse(null, { status: 200 });\n })\n ),\n http.get(`${useradmApiUrl}/users`, () => HttpResponse.json(Object.values(mockApiResponses.users.byId))),\n http.get(`${useradmApiUrl}/users/me`, ({ request }) => {\n const authHeader = request.headers.get('authorization');\n if (authHeader?.includes('limited')) {\n return new HttpResponse(JSON.stringify({ error: 'forbidden by role-based access control' }), { status: 403 });\n }\n return HttpResponse.json(mockApiResponses.users.byId[defaultUserId]);\n }),\n http.get(`${useradmApiUrl}/users/exists`, ({ request }) => {\n const url = new URL(request.url);\n const email = url.searchParams.get('email');\n if (!decodeURIComponent(email).includes('child+123')) {\n return new HttpResponse(null, { status: 578 });\n }\n return HttpResponse.json({ exists: true });\n }),\n http.get(`${useradmApiUrl}/users/:userId`, ({ params: { userId } }) => {\n if (userId === 'me' || mockApiResponses.users.byId[userId]) {\n const user = userId === 'me' ? defaultUserId : userId;\n return HttpResponse.json(mockApiResponses.users.byId[user]);\n }\n return new HttpResponse(null, { status: 563 });\n }),\n http.post(\n `${useradmApiUrl}/users`,\n validated(async ({ request }) => {\n const { email, password } = await request.json();\n if (email === 'test@test.com' || [email, password].every(value => value)) {\n return HttpResponse.json(mockApiResponses.users.byId.a1);\n }\n return new HttpResponse(null, { status: 564 });\n })\n ),\n http.put(\n `${useradmApiUrl}/users/:userId`,\n validated(async ({ params: { userId }, request }) => {\n const { email, password, current_password } = await request.json();\n if (current_password === 'bad_password') {\n return new HttpResponse(null, { status: 401 });\n }\n if (\n (mockApiResponses.users.byId[userId] && [email, password].some(value => Object.values(mockApiResponses.users.byId[userId]).includes(value))) ||\n email === 'test@test.com'\n ) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 565 });\n })\n ),\n http.delete(\n `${useradmApiUrl}/users/:userId`,\n ({ params: { userId } }) => new HttpResponse(null, { status: mockApiResponses.users.byId[userId] ? 200 : 566 })\n ),\n http.get(`${useradmApiUrl}/roles`, () => HttpResponse.json(rbacRoles)),\n http.post(\n `${useradmApiUrl}/roles`,\n validated(async ({ request }) => {\n const { name, permissions } = await request.json();\n if (\n [name, permissions].every(value => value) &&\n permissions.every(permission => permission.action && permission.object && permission.object.type && permission.object.value)\n ) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 567 });\n })\n ),\n http.put(\n `${useradmApiUrl}/roles/:roleId`,\n validated(async ({ params: { roleId }, request }) => {\n const { description, name, permissions } = await request.json();\n if (mockApiResponses.users.rolesById[roleId] && [description, name, permissions].some(value => value)) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 568 });\n })\n ),\n http.post(`${useradmApiUrlv2}/support/feedback/product`, async () => new HttpResponse(null, { status: 200 })),\n http.delete(\n `${useradmApiUrl}/roles/:roleId`,\n ({ params: { roleId } }) => new HttpResponse(null, { status: mockApiResponses.users.rolesById[roleId] ? 200 : 569 })\n ),\n http.get(`${useradmApiUrlv2}/roles`, () => HttpResponse.json(rbacRoles)),\n http.get(`${useradmApiUrlv2}/roles/:roleId`, async ({ params: { roleId } }) => {\n if (mockApiResponses.users.rolesById[roleId]) {\n return HttpResponse.json(mockApiResponses.users.rolesById[roleId]);\n }\n return new HttpResponse(null, { status: 571 });\n }),\n http.post(\n `${useradmApiUrlv2}/roles`,\n validated(async ({ request }) => {\n const { name, permission_sets_with_scope } = await request.json();\n if (\n !!name &&\n permission_sets_with_scope.every(permission => permission.name && permissionSets.find(permissionSet => permissionSet.name === permission.name))\n ) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 572 });\n })\n ),\n http.put(\n `${useradmApiUrlv2}/roles/:roleId`,\n validated(async ({ params: { roleId }, request }) => {\n const { description, name, permission_sets_with_scope } = await request.json();\n if (mockApiResponses.users.rolesById[roleId] && [description, name, permission_sets_with_scope].some(value => value)) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 573 });\n })\n ),\n http.delete(`${useradmApiUrlv2}/roles/:roleId`, ({ params: { roleId } }) => {\n if (mockApiResponses.users.rolesById[roleId]) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 574 });\n }),\n http.get(`${useradmApiUrl}/settings`, () => HttpResponse.json(mockApiResponses.users.globalSettings)),\n http.post(`${useradmApiUrl}/settings`, () => new HttpResponse(null, { status: 200 })),\n http.get(`${useradmApiUrl}/settings/me`, () => HttpResponse.json(mockApiResponses.users.userSettings)),\n http.post(`${useradmApiUrl}/settings/me`, () => new HttpResponse(null, { status: 200 })),\n http.get(`${useradmApiUrl}/settings/tokens`, () => HttpResponse.json(accessTokens)),\n http.post(`${useradmApiUrl}/settings/tokens`, () => HttpResponse.json('aNewToken')),\n http.delete(\n `${useradmApiUrl}/settings/tokens/:tokenId`,\n ({ params: { tokenId } }) => new HttpResponse(null, { status: tokenId === 'some-id-1' ? 200 : 577 })\n ),\n http.get(`${useradmApiUrl}/2faqr`, () => HttpResponse.json({ qr: btoa('test') })),\n http.post(`${useradmApiUrl}/users/:userId/2fa/enable`, ({ params: { userId } }) => {\n if (mockApiResponses.users.byId[userId] || userId === 'me') {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 570 });\n }),\n http.post(`${useradmApiUrl}/users/:userId/2fa/disable`, ({ params: { userId } }) => {\n if (mockApiResponses.users.byId[userId] || userId === 'me') {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 571 });\n }),\n http.post(`${useradmApiUrl}/auth/verify-email/start`, () => new HttpResponse(null, { status: 200 })),\n http.post(\n `${useradmApiUrl}/auth/verify-email/complete`,\n validated(async ({ request }) => {\n const { secret_hash } = await request.json();\n return new HttpResponse(null, { status: secret_hash === 'superSecret' ? 200 : 576 });\n })\n ),\n http.get(`${useradmApiUrlv2}/permission_sets`, () => HttpResponse.json(permissionSets)),\n http.post(\n `${useradmApiUrl}/users/:userId/assign`,\n validated(async ({ request }) => {\n const { tenant_ids } = await request.json();\n return new HttpResponse(null, { status: tenant_ids.length ? 200 : 577 });\n })\n ),\n http.get(`${useradmApiUrl}/users/tenants/:tenantId/token`, () => HttpResponse.text('differentToken')),\n http.post(`${useradmApiUrl}/oauth2/link`, ({ request }) => {\n const authHeader = request.headers.get('authorization');\n const authInfo = atob(authHeader?.split(' ')[1]);\n const [user, password] = authInfo.split(':');\n\n if (password !== defaultPassword) {\n return new HttpResponse(null, { status: 401 });\n } else if (user.includes('2fa')) {\n return new HttpResponse(JSON.stringify({ error: '2fa needed' }), { status: 401 });\n }\n\n return new HttpResponse(token, { headers: { 'Content-Type': APPLICATION_JWT_CONTENT_TYPE } });\n })\n];\n"],"mappings":";;;;;AAoBA,MAAa,eAAe;CAC1B,KAAK,KAAK,GAAG,cAAc,eAAe,EAAE,cAAc;EACxD,MAAM,aAAa,QAAQ,QAAQ,IAAI,eAAe;EAEtD,MAAM,CAAC,MAAM,YADI,KAAK,YAAY,MAAM,GAAG,EAAE,EACb,EAAE,MAAM,GAAG;EAE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zE,CAAC,CACH;CACA,KAAK,IAAI,GAAG,cAAc,uCAAuC,aAAa,KAAK,gBAAgB,CAAC;CACpG,KAAK,KAAK,GAAG,cAAc,gBAAgB,EAAE,cAAc;EACzD,MAAM,aAAa,QAAQ,QAAQ,IAAI,eAAe;EAEtD,MAAM,CAAC,MAAM,YADI,KAAK,YAAY,MAAM,GAAG,EAAE,EACb,EAAE,MAAM,GAAG;EAE3C,IAAI,aAAA,wBACF,OAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,IAAI,CAAC;OACxC,IAAI,KAAK,SAAS,KAAK,GAC5B,OAAO,IAAI,aAAa,KAAK,UAAU,EAAE,OAAO,aAAa,CAAC,GAAG,EAAE,QAAQ,IAAI,CAAC;EAGlF,OAAO,IAAI,aAAa,OAAO,EAAE,SAAS,EAAE,gBAAgB,6BAA6B,EAAE,CAAC;CAC9F,CAAC;AACH"}
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_validation = require("../validation-ofsPAnds.cjs");
2
+ const require_validation = require("../validation-sI3hdTHq.cjs");
3
3
  exports.validateRequest = require_validation.validateRequest;
4
4
  exports.validated = require_validation.validated;
@@ -1,2 +1,2 @@
1
- import { n as validated, t as validateRequest } from "../validation-BhqZNZ-s.js";
1
+ import { n as validated, t as validateRequest } from "../validation-caoivLBj.js";
2
2
  export { validateRequest, validated };
@@ -26,7 +26,7 @@ const require_utils = require("./utils.cjs");
26
26
  let react = require("react");
27
27
  react = __toESM(react);
28
28
  let react_redux = require("react-redux");
29
- let react_router_dom = require("react-router-dom");
29
+ let react_router = require("react-router");
30
30
  let _emotion_jest = require("@emotion/jest");
31
31
  let _mui_material_styles = require("@mui/material/styles");
32
32
  let _northern_tech_utils_helpers = require("@northern.tech/utils/helpers");
@@ -139,7 +139,7 @@ const customRender = (ui, options = {}) => {
139
139
  const store = options.store ?? (0, _reduxjs_toolkit.configureStore)({ preloadedState });
140
140
  const AllTheProviders = ({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_styles.ThemeProvider, {
141
141
  theme: require_utils.theme,
142
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.MemoryRouter, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_redux.Provider, {
142
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router.MemoryRouter, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_redux.Provider, {
143
143
  store,
144
144
  children
145
145
  }) })
@@ -154,7 +154,6 @@ const customRender = (ui, options = {}) => {
154
154
  };
155
155
  //#endregion
156
156
  exports.TEST_LOCATION = TEST_LOCATION;
157
- exports.__toESM = __toESM;
158
157
  exports.afterAll = afterAll;
159
158
  exports.afterEach = afterEach;
160
159
  exports.beforeAll = beforeAll;
@@ -1 +1 @@
1
- {"version":3,"file":"setupTests.cjs","names":["expect","vi","yes","mockToken","menderEnvironment","MessageChannel","React","mockDate","ThemeProvider","theme","MemoryRouter","Provider"],"sources":["../src/setupTests.tsx"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport React from 'react';\nimport { Provider } from 'react-redux';\nimport { MemoryRouter } from 'react-router-dom';\n\nimport { createSerializer } from '@emotion/jest';\nimport { ThemeProvider } from '@mui/material/styles';\n\nimport { yes } from '@northern.tech/utils/helpers';\nimport { configureStore } from '@reduxjs/toolkit';\nimport '@testing-library/jest-dom/vitest';\nimport { cleanup, render } from '@testing-library/react';\nimport { expect, vi } from 'vitest';\nimport { MessageChannel } from 'worker_threads';\n\nimport { menderEnvironment, mockDate, token as mockToken } from './mockData';\nimport { theme } from './utils';\n\nexpect.addSnapshotSerializer(createSerializer({ includeStyles: true }));\n\nexport const TEST_LOCATION = 'localhost';\n\nexport const mockAbortController: { abort: () => void; signal: { addEventListener: () => void; removeEventListener: () => void } } = {\n abort: vi.fn(),\n signal: { addEventListener: () => {}, removeEventListener: () => {} }\n};\n\nconst oldWindowLocalStorage = window.localStorage;\nconst oldWindowLocation = window.location;\nconst oldWindowSessionStorage = window.sessionStorage;\n\nvi.mock('uuid', () => ({ v4: () => 'mock-uuid' }));\n\nconst storage = {};\nglobal.HTMLCanvasElement.prototype.getContext = vi.fn();\n\nexport const beforeAll = async () => {\n // Temporarily workaround for bug in @testing-library/react when use user-event with `vi.useFakeTimers()`\n\n // Enable the mocking in tests.\n delete window.location;\n window.location = {\n ...oldWindowLocation,\n hostname: TEST_LOCATION,\n origin: 'http://localhost',\n assign: vi.fn(),\n replace: vi.fn(),\n reload: vi.fn()\n };\n delete window.sessionStorage;\n window.sessionStorage = {\n ...oldWindowSessionStorage,\n getItem: vi.fn(yes),\n setItem: vi.fn(),\n removeItem: vi.fn()\n };\n delete window.localStorage;\n window.localStorage = {\n ...oldWindowLocalStorage,\n getItem: vi.fn(name => {\n if (name === 'JWT') {\n return JSON.stringify({ token: mockToken });\n }\n return storage[name];\n }),\n setItem: vi.fn(name => storage[name]),\n removeItem: vi.fn()\n };\n window.mender_environment = menderEnvironment;\n window.ENV = 'test';\n global.AbortController = vi.fn().mockImplementation(function () {\n return mockAbortController;\n });\n global.MessageChannel = MessageChannel;\n global.ResizeObserver = vi.fn().mockImplementation(function () {\n return {\n observe: vi.fn(),\n unobserve: vi.fn(),\n disconnect: vi.fn()\n };\n });\n window.RTCPeerConnection = () => ({\n createOffer: () => {},\n setLocalDescription: () => {},\n createDataChannel: () => {}\n });\n\n Object.defineProperty(navigator, 'appVersion', { value: 'Test', writable: true });\n const intersectionObserverMock = function () {\n return {\n observe: vi.fn(),\n disconnect: vi.fn()\n };\n };\n window.prompt = vi.fn();\n window.IntersectionObserver = vi.fn().mockImplementation(intersectionObserverMock);\n vi.spyOn(React, 'useEffect').mockImplementation(React.useLayoutEffect);\n\n //TODO: remove, once https://github.com/testing-library/react-testing-library/issues/1197 resolved\n const _jest = globalThis.jest;\n\n globalThis.jest = {\n ...globalThis.jest\n };\n\n vi.stubGlobal('jest', {\n advanceTimersByTime: vi.advanceTimersByTime.bind(vi)\n });\n return () => void (globalThis.jest = _jest);\n};\n\nexport const beforeEach = () => {\n vi.useFakeTimers({ now: mockDate });\n vi.setSystemTime(mockDate);\n};\n\nexport const afterEach = async () => {\n cleanup();\n vi.runOnlyPendingTimers();\n vi.useRealTimers();\n};\n\nexport const afterAll = async () => {\n // restore `window.location` etc. to the original `jsdom` `Location` object\n window.localStorage = oldWindowLocalStorage;\n window.location = oldWindowLocation;\n window.sessionStorage = oldWindowSessionStorage;\n React.useEffect.mockRestore();\n vi.unstubAllGlobals();\n};\n\nconst customRender = (ui, options = {}) => {\n const { preloadedState = { users: { currentSession: { token: mockToken, expiresAt: undefined } } }, ...remainder } = options;\n const store = options.store ?? configureStore({ preloadedState });\n const AllTheProviders = ({ children }) => (\n <ThemeProvider theme={theme}>\n <MemoryRouter>\n <Provider store={store}>{children}</Provider>\n </MemoryRouter>\n </ThemeProvider>\n );\n return { store, ...render(ui, { wrapper: AllTheProviders, ...remainder }) };\n};\n\nexport * from '@testing-library/react';\n// override render method\n\nexport { customRender as render };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BAA,OAAAA,OAAO,uBAAA,GAAA,cAAA,kBAAuC,EAAE,eAAe,MAAM,CAAC,CAAC;AAEvE,MAAa,gBAAgB;AAE7B,MAAa,sBAAwH;CACnI,OAAOC,OAAAA,GAAG,IAAI;CACd,QAAQ;EAAE,wBAAwB;EAAI,2BAA2B;EAAI;CACtE;AAED,MAAM,wBAAwB,OAAO;AACrC,MAAM,oBAAoB,OAAO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AAAA;YACpB,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,cAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,UAAD;GAAiB;GAAQ;GAAoB,CAAA,EAChC,CAAA;EACD,CAAA;CAElB,OAAO;EAAE;EAAO,IAAA,GAAA,uBAAA,QAAU,IAAI;GAAE,SAAS;GAAiB,GAAG;GAAW,CAAC;EAAE"}
1
+ {"version":3,"file":"setupTests.cjs","names":["expect","vi","yes","mockToken","menderEnvironment","MessageChannel","React","mockDate","ThemeProvider","theme","MemoryRouter","Provider"],"sources":["../src/setupTests.tsx"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport React from 'react';\nimport { Provider } from 'react-redux';\nimport { MemoryRouter } from 'react-router';\n\nimport { createSerializer } from '@emotion/jest';\nimport { ThemeProvider } from '@mui/material/styles';\n\nimport { yes } from '@northern.tech/utils/helpers';\nimport { configureStore } from '@reduxjs/toolkit';\nimport '@testing-library/jest-dom/vitest';\nimport { cleanup, render } from '@testing-library/react';\nimport { expect, vi } from 'vitest';\nimport { MessageChannel } from 'worker_threads';\n\nimport { menderEnvironment, mockDate, token as mockToken } from './mockData';\nimport { theme } from './utils';\n\nexpect.addSnapshotSerializer(createSerializer({ includeStyles: true }));\n\nexport const TEST_LOCATION = 'localhost';\n\nexport const mockAbortController: { abort: () => void; signal: { addEventListener: () => void; removeEventListener: () => void } } = {\n abort: vi.fn(),\n signal: { addEventListener: () => {}, removeEventListener: () => {} }\n};\n\nconst oldWindowLocalStorage = window.localStorage;\nconst oldWindowLocation = window.location;\nconst oldWindowSessionStorage = window.sessionStorage;\n\nvi.mock('uuid', () => ({ v4: () => 'mock-uuid' }));\n\nconst storage = {};\nglobal.HTMLCanvasElement.prototype.getContext = vi.fn();\n\nexport const beforeAll = async () => {\n // Temporarily workaround for bug in @testing-library/react when use user-event with `vi.useFakeTimers()`\n\n // Enable the mocking in tests.\n delete window.location;\n window.location = {\n ...oldWindowLocation,\n hostname: TEST_LOCATION,\n origin: 'http://localhost',\n assign: vi.fn(),\n replace: vi.fn(),\n reload: vi.fn()\n };\n delete window.sessionStorage;\n window.sessionStorage = {\n ...oldWindowSessionStorage,\n getItem: vi.fn(yes),\n setItem: vi.fn(),\n removeItem: vi.fn()\n };\n delete window.localStorage;\n window.localStorage = {\n ...oldWindowLocalStorage,\n getItem: vi.fn(name => {\n if (name === 'JWT') {\n return JSON.stringify({ token: mockToken });\n }\n return storage[name];\n }),\n setItem: vi.fn(name => storage[name]),\n removeItem: vi.fn()\n };\n window.mender_environment = menderEnvironment;\n window.ENV = 'test';\n global.AbortController = vi.fn().mockImplementation(function () {\n return mockAbortController;\n });\n global.MessageChannel = MessageChannel;\n global.ResizeObserver = vi.fn().mockImplementation(function () {\n return {\n observe: vi.fn(),\n unobserve: vi.fn(),\n disconnect: vi.fn()\n };\n });\n window.RTCPeerConnection = () => ({\n createOffer: () => {},\n setLocalDescription: () => {},\n createDataChannel: () => {}\n });\n\n Object.defineProperty(navigator, 'appVersion', { value: 'Test', writable: true });\n const intersectionObserverMock = function () {\n return {\n observe: vi.fn(),\n disconnect: vi.fn()\n };\n };\n window.prompt = vi.fn();\n window.IntersectionObserver = vi.fn().mockImplementation(intersectionObserverMock);\n vi.spyOn(React, 'useEffect').mockImplementation(React.useLayoutEffect);\n\n //TODO: remove, once https://github.com/testing-library/react-testing-library/issues/1197 resolved\n const _jest = globalThis.jest;\n\n globalThis.jest = {\n ...globalThis.jest\n };\n\n vi.stubGlobal('jest', {\n advanceTimersByTime: vi.advanceTimersByTime.bind(vi)\n });\n return () => void (globalThis.jest = _jest);\n};\n\nexport const beforeEach = () => {\n vi.useFakeTimers({ now: mockDate });\n vi.setSystemTime(mockDate);\n};\n\nexport const afterEach = async () => {\n cleanup();\n vi.runOnlyPendingTimers();\n vi.useRealTimers();\n};\n\nexport const afterAll = async () => {\n // restore `window.location` etc. to the original `jsdom` `Location` object\n window.localStorage = oldWindowLocalStorage;\n window.location = oldWindowLocation;\n window.sessionStorage = oldWindowSessionStorage;\n React.useEffect.mockRestore();\n vi.unstubAllGlobals();\n};\n\nconst customRender = (ui, options = {}) => {\n const { preloadedState = { users: { currentSession: { token: mockToken, expiresAt: undefined } } }, ...remainder } = options;\n const store = options.store ?? configureStore({ preloadedState });\n const AllTheProviders = ({ children }) => (\n <ThemeProvider theme={theme}>\n <MemoryRouter>\n <Provider store={store}>{children}</Provider>\n </MemoryRouter>\n </ThemeProvider>\n );\n return { store, ...render(ui, { wrapper: AllTheProviders, ...remainder }) };\n};\n\nexport * from '@testing-library/react';\n// override render method\n\nexport { customRender as render };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BAA,OAAAA,OAAO,uBAAA,GAAA,cAAA,kBAAuC,EAAE,eAAe,KAAK,CAAC,CAAC;AAEtE,MAAa,gBAAgB;AAE7B,MAAa,sBAAwH;CACnI,OAAOC,OAAAA,GAAG,GAAG;CACb,QAAQ;EAAE,wBAAwB,CAAC;EAAG,2BAA2B,CAAC;CAAE;AACtE;AAEA,MAAM,wBAAwB,OAAO;AACrC,MAAM,oBAAoB,OAAO;AACjC,MAAM,0BAA0B,OAAO;AAEvCA,OAAAA,GAAG,KAAK,eAAe,EAAE,UAAU,YAAY,EAAE;AAEjD,MAAM,UAAU,CAAC;AACjB,OAAO,kBAAkB,UAAU,aAAaA,OAAAA,GAAG,GAAG;AAEtD,MAAa,YAAY,YAAY;CAInC,OAAO,OAAO;CACd,OAAO,WAAW;EAChB,GAAG;EACH,UAAU;EACV,QAAQ;EACR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GAAE,SAAS;GAAiB,GAAG;EAAU,CAAC;CAAE;AAC5E"}
@@ -1,6 +1,3 @@
1
- import * as _$react_dom_client0 from "react-dom/client";
2
- import * as _$pretty_format0 from "pretty-format";
3
- import * as _$_testing_library_dom0 from "@testing-library/dom";
4
1
  import React from "react";
5
2
  export * from "@testing-library/react";
6
3
 
@@ -20,58 +17,58 @@ declare const afterAll: () => Promise<void>;
20
17
  declare const customRender: (ui: any, options?: {}) => {
21
18
  container: HTMLElement;
22
19
  baseElement: HTMLElement;
23
- debug: (baseElement?: _$react_dom_client0.Container | (Element | Document) | Array<_$react_dom_client0.Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: _$pretty_format0.OptionsReceived | undefined) => void;
20
+ debug: (baseElement?: import("react-dom/client").Container | (Element | Document) | Array<import("react-dom/client").Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: import("pretty-format").OptionsReceived | undefined) => void;
24
21
  rerender: (ui: React.ReactNode) => void;
25
22
  unmount: () => void;
26
23
  asFragment: () => DocumentFragment;
27
- getByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement;
28
- getAllByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement[];
29
- queryByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement | null;
30
- queryAllByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement[];
31
- findByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
32
- findAllByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
33
- getByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
34
- getAllByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
35
- queryByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
36
- queryAllByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
37
- findByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
38
- findAllByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
39
- getByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement;
40
- getAllByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement[];
41
- queryByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement | null;
42
- queryAllByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement[];
43
- findByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
44
- findAllByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
45
- getByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
46
- getAllByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
47
- queryByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
48
- queryAllByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
49
- findByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
50
- findAllByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
51
- getByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
52
- getAllByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
53
- queryByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
54
- queryAllByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
55
- findByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
56
- findAllByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
57
- getByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
58
- getAllByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
59
- queryByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
60
- queryAllByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
61
- findByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
62
- findAllByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
63
- getByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined) => HTMLElement;
64
- getAllByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined) => HTMLElement[];
65
- queryByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined) => HTMLElement | null;
66
- queryAllByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined) => HTMLElement[];
67
- findByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
68
- findAllByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
69
- getByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
70
- getAllByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
71
- queryByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
72
- queryAllByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
73
- findByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
74
- findAllByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
24
+ getByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
25
+ getAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
26
+ queryByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
27
+ queryAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
28
+ findByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
29
+ findAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
30
+ getByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
31
+ getAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
32
+ queryByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
33
+ queryAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
34
+ findByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
35
+ findAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
36
+ getByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
37
+ getAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
38
+ queryByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
39
+ queryAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
40
+ findByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
41
+ findAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
42
+ getByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
43
+ getAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
44
+ queryByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
45
+ queryAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
46
+ findByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
47
+ findAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
48
+ getByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
49
+ getAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
50
+ queryByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
51
+ queryAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
52
+ findByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
53
+ findAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
54
+ getByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
55
+ getAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
56
+ queryByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
57
+ queryAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
58
+ findByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
59
+ findAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
60
+ getByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement;
61
+ getAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement[];
62
+ queryByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement | null;
63
+ queryAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement[];
64
+ findByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
65
+ findAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
66
+ getByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
67
+ getAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
68
+ queryByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
69
+ queryAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
70
+ findByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
71
+ findAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
75
72
  store: any;
76
73
  };
77
74
  //#endregion
@@ -1,7 +1,4 @@
1
1
  import React from "react";
2
- import * as _$react_dom_client0 from "react-dom/client";
3
- import * as _$pretty_format0 from "pretty-format";
4
- import * as _$_testing_library_dom0 from "@testing-library/dom";
5
2
  export * from "@testing-library/react";
6
3
 
7
4
  //#region src/setupTests.d.ts
@@ -20,58 +17,58 @@ declare const afterAll: () => Promise<void>;
20
17
  declare const customRender: (ui: any, options?: {}) => {
21
18
  container: HTMLElement;
22
19
  baseElement: HTMLElement;
23
- debug: (baseElement?: _$react_dom_client0.Container | (Element | Document) | Array<_$react_dom_client0.Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: _$pretty_format0.OptionsReceived | undefined) => void;
20
+ debug: (baseElement?: import("react-dom/client").Container | (Element | Document) | Array<import("react-dom/client").Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: import("pretty-format").OptionsReceived | undefined) => void;
24
21
  rerender: (ui: React.ReactNode) => void;
25
22
  unmount: () => void;
26
23
  asFragment: () => DocumentFragment;
27
- getByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement;
28
- getAllByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement[];
29
- queryByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement | null;
30
- queryAllByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement[];
31
- findByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
32
- findAllByLabelText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
33
- getByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
34
- getAllByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
35
- queryByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
36
- queryAllByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
37
- findByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
38
- findAllByPlaceholderText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
39
- getByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement;
40
- getAllByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement[];
41
- queryByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement | null;
42
- queryAllByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined) => HTMLElement[];
43
- findByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
44
- findAllByText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.SelectorMatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
45
- getByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
46
- getAllByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
47
- queryByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
48
- queryAllByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
49
- findByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
50
- findAllByAltText: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
51
- getByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
52
- getAllByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
53
- queryByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
54
- queryAllByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
55
- findByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
56
- findAllByTitle: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
57
- getByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
58
- getAllByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
59
- queryByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
60
- queryAllByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
61
- findByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
62
- findAllByDisplayValue: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
63
- getByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined) => HTMLElement;
64
- getAllByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined) => HTMLElement[];
65
- queryByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined) => HTMLElement | null;
66
- queryAllByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined) => HTMLElement[];
67
- findByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
68
- findAllByRole: (role: _$_testing_library_dom0.ByRoleMatcher, options?: _$_testing_library_dom0.ByRoleOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
69
- getByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement;
70
- getAllByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
71
- queryByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement | null;
72
- queryAllByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined) => HTMLElement[];
73
- findByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement>;
74
- findAllByTestId: (id: _$_testing_library_dom0.Matcher, options?: _$_testing_library_dom0.MatcherOptions | undefined, waitForElementOptions?: _$_testing_library_dom0.waitForOptions | undefined) => Promise<HTMLElement[]>;
24
+ getByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
25
+ getAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
26
+ queryByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
27
+ queryAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
28
+ findByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
29
+ findAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
30
+ getByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
31
+ getAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
32
+ queryByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
33
+ queryAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
34
+ findByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
35
+ findAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
36
+ getByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
37
+ getAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
38
+ queryByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
39
+ queryAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
40
+ findByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
41
+ findAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
42
+ getByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
43
+ getAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
44
+ queryByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
45
+ queryAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
46
+ findByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
47
+ findAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
48
+ getByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
49
+ getAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
50
+ queryByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
51
+ queryAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
52
+ findByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
53
+ findAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
54
+ getByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
55
+ getAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
56
+ queryByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
57
+ queryAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
58
+ findByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
59
+ findAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
60
+ getByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement;
61
+ getAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement[];
62
+ queryByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement | null;
63
+ queryAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement[];
64
+ findByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
65
+ findAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
66
+ getByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
67
+ getAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
68
+ queryByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
69
+ queryAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
70
+ findByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
71
+ findAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
75
72
  store: any;
76
73
  };
77
74
  //#endregion
@@ -2,7 +2,7 @@ import { menderEnvironment, mockDate, token } from "./mockData.js";
2
2
  import { theme } from "./utils.js";
3
3
  import React from "react";
4
4
  import { Provider } from "react-redux";
5
- import { MemoryRouter } from "react-router-dom";
5
+ import { MemoryRouter } from "react-router";
6
6
  import { createSerializer } from "@emotion/jest";
7
7
  import { ThemeProvider } from "@mui/material/styles";
8
8
  import { yes } from "@northern.tech/utils/helpers";
@@ -1 +1 @@
1
- {"version":3,"file":"setupTests.js","names":["mockToken"],"sources":["../src/setupTests.tsx"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport React from 'react';\nimport { Provider } from 'react-redux';\nimport { MemoryRouter } from 'react-router-dom';\n\nimport { createSerializer } from '@emotion/jest';\nimport { ThemeProvider } from '@mui/material/styles';\n\nimport { yes } from '@northern.tech/utils/helpers';\nimport { configureStore } from '@reduxjs/toolkit';\nimport '@testing-library/jest-dom/vitest';\nimport { cleanup, render } from '@testing-library/react';\nimport { expect, vi } from 'vitest';\nimport { MessageChannel } from 'worker_threads';\n\nimport { menderEnvironment, mockDate, token as mockToken } from './mockData';\nimport { theme } from './utils';\n\nexpect.addSnapshotSerializer(createSerializer({ includeStyles: true }));\n\nexport const TEST_LOCATION = 'localhost';\n\nexport const mockAbortController: { abort: () => void; signal: { addEventListener: () => void; removeEventListener: () => void } } = {\n abort: vi.fn(),\n signal: { addEventListener: () => {}, removeEventListener: () => {} }\n};\n\nconst oldWindowLocalStorage = window.localStorage;\nconst oldWindowLocation = window.location;\nconst oldWindowSessionStorage = window.sessionStorage;\n\nvi.mock('uuid', () => ({ v4: () => 'mock-uuid' }));\n\nconst storage = {};\nglobal.HTMLCanvasElement.prototype.getContext = vi.fn();\n\nexport const beforeAll = async () => {\n // Temporarily workaround for bug in @testing-library/react when use user-event with `vi.useFakeTimers()`\n\n // Enable the mocking in tests.\n delete window.location;\n window.location = {\n ...oldWindowLocation,\n hostname: TEST_LOCATION,\n origin: 'http://localhost',\n assign: vi.fn(),\n replace: vi.fn(),\n reload: vi.fn()\n };\n delete window.sessionStorage;\n window.sessionStorage = {\n ...oldWindowSessionStorage,\n getItem: vi.fn(yes),\n setItem: vi.fn(),\n removeItem: vi.fn()\n };\n delete window.localStorage;\n window.localStorage = {\n ...oldWindowLocalStorage,\n getItem: vi.fn(name => {\n if (name === 'JWT') {\n return JSON.stringify({ token: mockToken });\n }\n return storage[name];\n }),\n setItem: vi.fn(name => storage[name]),\n removeItem: vi.fn()\n };\n window.mender_environment = menderEnvironment;\n window.ENV = 'test';\n global.AbortController = vi.fn().mockImplementation(function () {\n return mockAbortController;\n });\n global.MessageChannel = MessageChannel;\n global.ResizeObserver = vi.fn().mockImplementation(function () {\n return {\n observe: vi.fn(),\n unobserve: vi.fn(),\n disconnect: vi.fn()\n };\n });\n window.RTCPeerConnection = () => ({\n createOffer: () => {},\n setLocalDescription: () => {},\n createDataChannel: () => {}\n });\n\n Object.defineProperty(navigator, 'appVersion', { value: 'Test', writable: true });\n const intersectionObserverMock = function () {\n return {\n observe: vi.fn(),\n disconnect: vi.fn()\n };\n };\n window.prompt = vi.fn();\n window.IntersectionObserver = vi.fn().mockImplementation(intersectionObserverMock);\n vi.spyOn(React, 'useEffect').mockImplementation(React.useLayoutEffect);\n\n //TODO: remove, once https://github.com/testing-library/react-testing-library/issues/1197 resolved\n const _jest = globalThis.jest;\n\n globalThis.jest = {\n ...globalThis.jest\n };\n\n vi.stubGlobal('jest', {\n advanceTimersByTime: vi.advanceTimersByTime.bind(vi)\n });\n return () => void (globalThis.jest = _jest);\n};\n\nexport const beforeEach = () => {\n vi.useFakeTimers({ now: mockDate });\n vi.setSystemTime(mockDate);\n};\n\nexport const afterEach = async () => {\n cleanup();\n vi.runOnlyPendingTimers();\n vi.useRealTimers();\n};\n\nexport const afterAll = async () => {\n // restore `window.location` etc. to the original `jsdom` `Location` object\n window.localStorage = oldWindowLocalStorage;\n window.location = oldWindowLocation;\n window.sessionStorage = oldWindowSessionStorage;\n React.useEffect.mockRestore();\n vi.unstubAllGlobals();\n};\n\nconst customRender = (ui, options = {}) => {\n const { preloadedState = { users: { currentSession: { token: mockToken, expiresAt: undefined } } }, ...remainder } = options;\n const store = options.store ?? configureStore({ preloadedState });\n const AllTheProviders = ({ children }) => (\n <ThemeProvider theme={theme}>\n <MemoryRouter>\n <Provider store={store}>{children}</Provider>\n </MemoryRouter>\n </ThemeProvider>\n );\n return { store, ...render(ui, { wrapper: AllTheProviders, ...remainder }) };\n};\n\nexport * from '@testing-library/react';\n// override render method\n\nexport { customRender as render };\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,OAAO,sBAAsB,iBAAiB,EAAE,eAAe,MAAM,CAAC,CAAC;AAEvE,MAAa,gBAAgB;AAE7B,MAAa,sBAAwH;CACnI,OAAO,GAAG,I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AC3C,OAAO;GACL,SAAS,GAAG,IAAI;GAChB,YAAY,GAAG,IAAI;GACpB;;CAEH,OAAO,SAAS,GAAG,IAAI;CACvB,OAAO,uBAAuB,GAAG,IAAI,CAAC,mBAAmB,yBAAyB;CAClF,GAAG,MAAM,OAAO,YAAY,CAAC,mBAAmB,MAAM,gBAAgB;CAGtE,MAAM,QAAQ,WAAW;CAEzB,WAAW,OAAO,EAChB,GAAG,WAAW,MACf;CAED,GAAG,WAAW,QAAQ,EACpB,qBAAqB,GAAG,oBAAoB,KAAK,GAAG,EACrD,CAAC;CACF,aAAa,MAAM,WAAW,OAAO;;AAGvC,MAAa,mBAAmB;CAC9B,GAAG,cAAc,EAAE,KAAK,UAAU,CAAC;CACnC,GAAG,cAAc,SAAS;;AAG5B,MAAa,YAAY,YAAY;CACnC,SAAS;CACT,GAAG,sBAAsB;CACzB,GAAG,eAAe;;AAGpB,MAAa,WAAW,YAAY;CAElC,OAAO,eAAe;CACtB,OAAO,WAAW;CAClB,OAAO,iBAAiB;CACxB,MAAM,UAAU,aAAa;CAC7B,GAAG,kBAAkB;;AAGvB,MAAM,gBAAgB,IAAI,UAAU,EAAE,KAAK;CACzC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB;EAASA;EAAW,WAAW,KAAA;EAAW,EAAE,EAAE,EAAE,GAAG,cAAc;CACrH,MAAM,QAAQ,QAAQ,SAAS,eAAe,EAAE,gBAAgB,CAAC;CACjE,MAAM,mBAAmB,EAAE,eACzB,oBAAC,eAAD;EAAsB;YACpB,oBAAC,cAAD,EAAA,UACE,oBAAC,UAAD;GAAiB;GAAQ;GAAoB,CAAA,EAChC,CAAA;EACD,CAAA;CAElB,OAAO;EAAE;EAAO,GAAG,OAAO,IAAI;GAAE,SAAS;GAAiB,GAAG;GAAW,CAAC;EAAE"}
1
+ {"version":3,"file":"setupTests.js","names":["mockToken"],"sources":["../src/setupTests.tsx"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport React from 'react';\nimport { Provider } from 'react-redux';\nimport { MemoryRouter } from 'react-router';\n\nimport { createSerializer } from '@emotion/jest';\nimport { ThemeProvider } from '@mui/material/styles';\n\nimport { yes } from '@northern.tech/utils/helpers';\nimport { configureStore } from '@reduxjs/toolkit';\nimport '@testing-library/jest-dom/vitest';\nimport { cleanup, render } from '@testing-library/react';\nimport { expect, vi } from 'vitest';\nimport { MessageChannel } from 'worker_threads';\n\nimport { menderEnvironment, mockDate, token as mockToken } from './mockData';\nimport { theme } from './utils';\n\nexpect.addSnapshotSerializer(createSerializer({ includeStyles: true }));\n\nexport const TEST_LOCATION = 'localhost';\n\nexport const mockAbortController: { abort: () => void; signal: { addEventListener: () => void; removeEventListener: () => void } } = {\n abort: vi.fn(),\n signal: { addEventListener: () => {}, removeEventListener: () => {} }\n};\n\nconst oldWindowLocalStorage = window.localStorage;\nconst oldWindowLocation = window.location;\nconst oldWindowSessionStorage = window.sessionStorage;\n\nvi.mock('uuid', () => ({ v4: () => 'mock-uuid' }));\n\nconst storage = {};\nglobal.HTMLCanvasElement.prototype.getContext = vi.fn();\n\nexport const beforeAll = async () => {\n // Temporarily workaround for bug in @testing-library/react when use user-event with `vi.useFakeTimers()`\n\n // Enable the mocking in tests.\n delete window.location;\n window.location = {\n ...oldWindowLocation,\n hostname: TEST_LOCATION,\n origin: 'http://localhost',\n assign: vi.fn(),\n replace: vi.fn(),\n reload: vi.fn()\n };\n delete window.sessionStorage;\n window.sessionStorage = {\n ...oldWindowSessionStorage,\n getItem: vi.fn(yes),\n setItem: vi.fn(),\n removeItem: vi.fn()\n };\n delete window.localStorage;\n window.localStorage = {\n ...oldWindowLocalStorage,\n getItem: vi.fn(name => {\n if (name === 'JWT') {\n return JSON.stringify({ token: mockToken });\n }\n return storage[name];\n }),\n setItem: vi.fn(name => storage[name]),\n removeItem: vi.fn()\n };\n window.mender_environment = menderEnvironment;\n window.ENV = 'test';\n global.AbortController = vi.fn().mockImplementation(function () {\n return mockAbortController;\n });\n global.MessageChannel = MessageChannel;\n global.ResizeObserver = vi.fn().mockImplementation(function () {\n return {\n observe: vi.fn(),\n unobserve: vi.fn(),\n disconnect: vi.fn()\n };\n });\n window.RTCPeerConnection = () => ({\n createOffer: () => {},\n setLocalDescription: () => {},\n createDataChannel: () => {}\n });\n\n Object.defineProperty(navigator, 'appVersion', { value: 'Test', writable: true });\n const intersectionObserverMock = function () {\n return {\n observe: vi.fn(),\n disconnect: vi.fn()\n };\n };\n window.prompt = vi.fn();\n window.IntersectionObserver = vi.fn().mockImplementation(intersectionObserverMock);\n vi.spyOn(React, 'useEffect').mockImplementation(React.useLayoutEffect);\n\n //TODO: remove, once https://github.com/testing-library/react-testing-library/issues/1197 resolved\n const _jest = globalThis.jest;\n\n globalThis.jest = {\n ...globalThis.jest\n };\n\n vi.stubGlobal('jest', {\n advanceTimersByTime: vi.advanceTimersByTime.bind(vi)\n });\n return () => void (globalThis.jest = _jest);\n};\n\nexport const beforeEach = () => {\n vi.useFakeTimers({ now: mockDate });\n vi.setSystemTime(mockDate);\n};\n\nexport const afterEach = async () => {\n cleanup();\n vi.runOnlyPendingTimers();\n vi.useRealTimers();\n};\n\nexport const afterAll = async () => {\n // restore `window.location` etc. to the original `jsdom` `Location` object\n window.localStorage = oldWindowLocalStorage;\n window.location = oldWindowLocation;\n window.sessionStorage = oldWindowSessionStorage;\n React.useEffect.mockRestore();\n vi.unstubAllGlobals();\n};\n\nconst customRender = (ui, options = {}) => {\n const { preloadedState = { users: { currentSession: { token: mockToken, expiresAt: undefined } } }, ...remainder } = options;\n const store = options.store ?? configureStore({ preloadedState });\n const AllTheProviders = ({ children }) => (\n <ThemeProvider theme={theme}>\n <MemoryRouter>\n <Provider store={store}>{children}</Provider>\n </MemoryRouter>\n </ThemeProvider>\n );\n return { store, ...render(ui, { wrapper: AllTheProviders, ...remainder }) };\n};\n\nexport * from '@testing-library/react';\n// override render method\n\nexport { customRender as render };\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,OAAO,sBAAsB,iBAAiB,EAAE,eAAe,KAAK,CAAC,CAAC;AAEtE,MAAa,gBAAgB;AAE7B,MAAa,sBAAwH;CACnI,OAAO,GAAG,GAAG;CACb,QAAQ;EAAE,wBAAwB,CAAC;EAAG,2BAA2B,CAAC;CAAE;AACtE;AAEA,MAAM,wBAAwB,OAAO;AACrC,MAAM,oBAAoB,OAAO;AACjC,MAAM,0BAA0B,OAAO;AAEvC,GAAG,KAAK,eAAe,EAAE,UAAU,YAAY,EAAE;AAEjD,MAAM,UAAU,CAAC;AACjB,OAAO,kBAAkB,UAAU,aAAa,GAAG,GAAG;AAEtD,MAAa,YAAY,YAAY;CAInC,OAAO,OAAO;CACd,OAAO,WAAW;EAChB,GAAG;EACH,UAAU;EACV,QAAQ;EACR,QAAQ,GAAG,GAAG;EACd,SAAS,GAAG,GAAG;EACf,QAAQ,GAAG,GAAG;CAChB;CACA,OAAO,OAAO;CACd,OAAO,iBAAiB;EACtB,GAAG;EACH,SAAS,GAAG,GAAG,GAAG;EAClB,SAAS,GAAG,GAAG;EACf,YAAY,GAAG,GAAG;CACpB;CACA,OAAO,OAAO;CACd,OAAO,eAAe;EACpB,GAAG;EACH,SAAS,GAAG,IAAG,SAAQ;GACrB,IAAI,SAAS,OACX,OAAO,KAAK,UAAU,EAASA,MAAU,CAAC;GAE5C,OAAO,QAAQ;EACjB,CAAC;EACD,SAAS,GAAG,IAAG,SAAQ,QAAQ,KAAK;EACpC,YAAY,GAAG,GAAG;CACpB;CACA,OAAO,qBAAqB;CAC5B,OAAO,MAAM;CACb,OAAO,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WAAW,KAAA;CAAU,EAAE,EAAE,GAAG,GAAG,cAAc;CACrH,MAAM,QAAQ,QAAQ,SAAS,eAAe,EAAE,eAAe,CAAC;CAChE,MAAM,mBAAmB,EAAE,eACzB,oBAAC,eAAD;EAAsB;YACpB,oBAAC,cAAD,EAAA,UACE,oBAAC,UAAD;GAAiB;GAAQ;EAAmB,CAAA,EAChC,CAAA;CACD,CAAA;CAEjB,OAAO;EAAE;EAAO,GAAG,OAAO,IAAI;GAAE,SAAS;GAAiB,GAAG;EAAU,CAAC;CAAE;AAC5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"light.cjs","names":[],"sources":["../../src/theme/light.ts"],"sourcesContent":["// Copyright 2022 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ThemeOptions } from '@mui/material';\nimport { PaletteOptions } from '@mui/material/styles';\n\nconst palette: PaletteOptions = {\n border: {\n main: '#e3e3e3'\n },\n background: {\n default: '#fff'\n }\n};\n\nexport const light: ThemeOptions = {\n palette\n};\n"],"mappings":";AAyBA,MAAa,QAAsB,EACjC;CATA,QAAQ,EACN,MAAM,WACP;CACD,YAAY,EACV,SAAS,QACV;CAID,EACD"}
1
+ {"version":3,"file":"light.cjs","names":[],"sources":["../../src/theme/light.ts"],"sourcesContent":["// Copyright 2022 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ThemeOptions } from '@mui/material';\nimport { PaletteOptions } from '@mui/material/styles';\n\nconst palette: PaletteOptions = {\n border: {\n main: '#e3e3e3'\n },\n background: {\n default: '#fff'\n }\n};\n\nexport const light: ThemeOptions = {\n palette\n};\n"],"mappings":";AAyBA,MAAa,QAAsB,EACjC;CATA,QAAQ,EACN,MAAM,UACR;CACA,YAAY,EACV,SAAS,OACX;AAIA,EACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"light.js","names":[],"sources":["../../src/theme/light.ts"],"sourcesContent":["// Copyright 2022 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ThemeOptions } from '@mui/material';\nimport { PaletteOptions } from '@mui/material/styles';\n\nconst palette: PaletteOptions = {\n border: {\n main: '#e3e3e3'\n },\n background: {\n default: '#fff'\n }\n};\n\nexport const light: ThemeOptions = {\n palette\n};\n"],"mappings":"AAyBA,MAAa,QAAsB,EACjC;CATA,QAAQ,EACN,MAAM,WACP;CACD,YAAY,EACV,SAAS,QACV;CAID,EACD"}
1
+ {"version":3,"file":"light.js","names":[],"sources":["../../src/theme/light.ts"],"sourcesContent":["// Copyright 2022 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ThemeOptions } from '@mui/material';\nimport { PaletteOptions } from '@mui/material/styles';\n\nconst palette: PaletteOptions = {\n border: {\n main: '#e3e3e3'\n },\n background: {\n default: '#fff'\n }\n};\n\nexport const light: ThemeOptions = {\n palette\n};\n"],"mappings":"AAyBA,MAAa,QAAsB,EACjC;CATA,QAAQ,EACN,MAAM,UACR;CACA,YAAY,EACV,SAAS,OACX;AAIA,EACF"}
package/dist/utils.cjs CHANGED
@@ -1,6 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_theme_light = require("./theme/light.cjs");
3
- require("./setupTests.cjs");
4
3
  let _mui_material_styles = require("@mui/material/styles");
5
4
  let _testing_library_react = require("@testing-library/react");
6
5
  let vitest = require("vitest");
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","names":["light"],"sources":["../src/utils.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { createTheme } from '@mui/material/styles';\n\nimport { act, queryByRole, waitFor, within } from '@testing-library/react';\nimport { expect } from 'vitest';\n\nimport { light } from './theme/light';\n\nexport const selectMaterialUiSelectOption = async (element, optionText, user) => {\n // The button that opens the dropdown, which is a sibling of the input\n const selectButton = element.parentNode.querySelector('[role=combobox]');\n // Open the select dropdown\n await act(async () => await user.click(selectButton));\n // Get the dropdown element. We don't use getByRole() because it includes <select>s too.\n const listbox = queryByRole(document.documentElement, 'listbox');\n // Click the list item\n const listItem = within(listbox!).getByText(optionText);\n await user.click(listItem);\n // Wait for the listbox to be removed, so it isn't visible in subsequent calls\n await waitFor(() => expect(queryByRole(document.documentElement, 'listbox')).not.toBeInTheDocument());\n return Promise.resolve();\n};\n\nexport const theme = createTheme(light);\n"],"mappings":";;;;;;;AAoBA,MAAa,+BAA+B,OAAO,SAAS,YAAY,SAAS;CAE/E,MAAM,eAAe,QAAQ,WAAW,cAAc,kBAAkB;CAExE,OAAA,GAAA,uBAAA,KAAU,YAAY,MAAM,KAAK,MAAM,aAAa,CAAC;CAIrD,MAAM,YAAA,GAAA,uBAAA,SAAA,GAAA,uBAAA,aAFsB,SAAS,iBAAiB,UAEvB,CAAE,CAAC,UAAU,WAAW;CACvD,MAAM,KAAK,MAAM,SAAS;CAE1B,OAAA,GAAA,uBAAA,gBAAA,GAAA,OAAA,SAAA,GAAA,uBAAA,aAAuC,SAAS,iBAAiB,UAAU,CAAC,CAAC,IAAI,mBAAmB,CAAC;CACrG,OAAO,QAAQ,SAAS;;AAG1B,MAAa,SAAA,GAAA,qBAAA,aAAoBA,oBAAAA,MAAM"}
1
+ {"version":3,"file":"utils.cjs","names":["light"],"sources":["../src/utils.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { createTheme } from '@mui/material/styles';\n\nimport { act, queryByRole, waitFor, within } from '@testing-library/react';\nimport { expect } from 'vitest';\n\nimport { light } from './theme/light';\n\nexport const selectMaterialUiSelectOption = async (element, optionText, user) => {\n // The button that opens the dropdown, which is a sibling of the input\n const selectButton = element.parentNode.querySelector('[role=combobox]');\n // Open the select dropdown\n await act(async () => await user.click(selectButton));\n // Get the dropdown element. We don't use getByRole() because it includes <select>s too.\n const listbox = queryByRole(document.documentElement, 'listbox');\n // Click the list item\n const listItem = within(listbox!).getByText(optionText);\n await user.click(listItem);\n // Wait for the listbox to be removed, so it isn't visible in subsequent calls\n await waitFor(() => expect(queryByRole(document.documentElement, 'listbox')).not.toBeInTheDocument());\n return Promise.resolve();\n};\n\nexport const theme = createTheme(light);\n"],"mappings":";;;;;;AAoBA,MAAa,+BAA+B,OAAO,SAAS,YAAY,SAAS;CAE/E,MAAM,eAAe,QAAQ,WAAW,cAAc,iBAAiB;CAEvE,OAAA,GAAA,uBAAA,KAAU,YAAY,MAAM,KAAK,MAAM,YAAY,CAAC;CAIpD,MAAM,YAAA,GAAA,uBAAA,SAAA,GAAA,uBAAA,aAFsB,SAAS,iBAAiB,SAExB,CAAE,EAAE,UAAU,UAAU;CACtD,MAAM,KAAK,MAAM,QAAQ;CAEzB,OAAA,GAAA,uBAAA,gBAAA,GAAA,OAAA,SAAA,GAAA,uBAAA,aAAuC,SAAS,iBAAiB,SAAS,CAAC,EAAE,IAAI,kBAAkB,CAAC;CACpG,OAAO,QAAQ,QAAQ;AACzB;AAEA,MAAa,SAAA,GAAA,qBAAA,aAAoBA,oBAAAA,KAAK"}
package/dist/utils.d.cts CHANGED
@@ -1,8 +1,6 @@
1
- import * as _$_mui_material0 from "@mui/material";
2
-
3
1
  //#region src/utils.d.ts
4
2
  declare const selectMaterialUiSelectOption: (element: any, optionText: any, user: any) => Promise<void>;
5
- declare const theme: _$_mui_material0.Theme;
3
+ declare const theme: import("@mui/material").Theme;
6
4
  //#endregion
7
5
  export { selectMaterialUiSelectOption, theme };
8
6
  //# sourceMappingURL=utils.d.cts.map