From 8ab24c12686264d5298780c759db97c66def1d0f Mon Sep 17 00:00:00 2001 From: guilhermer Date: Wed, 13 Nov 2024 15:05:40 +0100 Subject: [PATCH] boleto tests --- packages/e2e-playwright/fixtures/URL_MAP.ts | 7 +- packages/e2e-playwright/models/address.ts | 14 +- packages/e2e-playwright/models/boleto.ts | 21 ++ .../e2e-playwright/models/personal-details.ts | 35 ++++ .../tests/e2e/vouchers/boleto/boleto.spec.ts | 90 ++------ packages/lib/config/jest.config.cjs | 8 +- packages/lib/package.json | 4 +- .../lib/src/components/Boleto/Boleto.test.ts | 191 +++++++++++++++++ .../stories/vouchers/Boleto.stories.tsx | 25 +++ yarn.lock | 196 +++++++++++++++++- 10 files changed, 508 insertions(+), 83 deletions(-) create mode 100644 packages/e2e-playwright/models/boleto.ts create mode 100644 packages/e2e-playwright/models/personal-details.ts create mode 100644 packages/lib/src/components/Boleto/Boleto.test.ts create mode 100644 packages/lib/storybook/stories/vouchers/Boleto.stories.tsx diff --git a/packages/e2e-playwright/fixtures/URL_MAP.ts b/packages/e2e-playwright/fixtures/URL_MAP.ts index 0d8b12c4e6..4a923ba0ab 100644 --- a/packages/e2e-playwright/fixtures/URL_MAP.ts +++ b/packages/e2e-playwright/fixtures/URL_MAP.ts @@ -25,5 +25,10 @@ export const URL_MAP = { riverty: '/iframe.html?globals=&args=&id=components-riverty--default&viewMode=story', rivertyWithVisibleSrPanel: '/iframe.html?args=srConfig.showPanel:!true&globals=&id=components-riverty--default&viewMode=story', /* Redirect */ - ideal: '/iframe.html?globals=&id=components-ideal--default&viewMode=story' + ideal: '/iframe.html?globals=&id=components-ideal--default&viewMode=story', + + /** + * Vouchers + */ + boleto: '/iframe.html?globals=&id=vouchers-boleto--default&viewMode=story' }; diff --git a/packages/e2e-playwright/models/address.ts b/packages/e2e-playwright/models/address.ts index 823ecc303a..1ffa9419d1 100644 --- a/packages/e2e-playwright/models/address.ts +++ b/packages/e2e-playwright/models/address.ts @@ -4,10 +4,7 @@ class Address { readonly rootElement: Locator; readonly rootElementSelector: string; - constructor( - public readonly page: Page, - rootElementSelector: string = '.adyen-checkout__fieldset--billingAddress' - ) { + constructor(public readonly page: Page, rootElementSelector: string = '.adyen-checkout__fieldset--billingAddress') { this.rootElement = page.locator(rootElementSelector); this.rootElementSelector = rootElementSelector; } @@ -36,10 +33,19 @@ class Address { return this.rootElement.getByRole('textbox', { exact: false, name: /code/i }); // US uses 'Zip Code', the rest uses 'Postal Code'; } + get stateInput() { + return this.rootElement.getByRole('combobox', { name: /state/i }); + } + async fillInPostCode(postCode: string) { await this.postalCodeInput.fill(postCode); } + async selectState(options: { name?: RegExp | string }) { + await this.stateInput.click(); + await this.rootElement.getByRole('option', options).click(); + } + async selectCountry(options: { name?: RegExp | string }) { await this.countrySelector.click(); await this.rootElement.getByRole('option', options).click(); diff --git a/packages/e2e-playwright/models/boleto.ts b/packages/e2e-playwright/models/boleto.ts new file mode 100644 index 0000000000..ccb7b99a1e --- /dev/null +++ b/packages/e2e-playwright/models/boleto.ts @@ -0,0 +1,21 @@ +import { Base } from './base'; +import { Address } from './address'; +import { Page } from '@playwright/test'; +import { PersonalDetails } from './personal-details'; + +class Boleto extends Base { + readonly billingAddress: Address; + readonly personalDetails: PersonalDetails; + + constructor(page: Page) { + super(page); + this.personalDetails = new PersonalDetails(page, { socialSecurityLabel: 'CPF/CNPJ' }); + this.billingAddress = new Address(page); + } + + get barcodeLocator() { + return this.page.locator('.adyen-checkout__voucher-result__code > img'); + } +} + +export default Boleto; diff --git a/packages/e2e-playwright/models/personal-details.ts b/packages/e2e-playwright/models/personal-details.ts new file mode 100644 index 0000000000..f4bf3e49be --- /dev/null +++ b/packages/e2e-playwright/models/personal-details.ts @@ -0,0 +1,35 @@ +import { Locator, Page } from '@playwright/test'; + +class PersonalDetails { + readonly rootElement: Locator; + readonly rootElementSelector: string; + + // Social security label varies per country + private readonly socialSecurityLabel: string; + + constructor( + public readonly page: Page, + options?: { + rootElementSelector?: string; + socialSecurityLabel?: string; + } + ) { + this.rootElementSelector = options.rootElementSelector || '.adyen-checkout__fieldset--personalDetails'; + this.rootElement = page.locator(this.rootElementSelector); + this.socialSecurityLabel = options?.socialSecurityLabel || 'Social security number'; + } + + get firstNameInput() { + return this.rootElement.getByRole('textbox', { name: /first name/i }); + } + + get lastNameInput() { + return this.rootElement.getByRole('textbox', { name: /last name/i }); + } + + get socialSecurityNumberInput() { + return this.rootElement.getByRole('textbox', { name: this.socialSecurityLabel }); + } +} + +export { PersonalDetails }; diff --git a/packages/e2e-playwright/tests/e2e/vouchers/boleto/boleto.spec.ts b/packages/e2e-playwright/tests/e2e/vouchers/boleto/boleto.spec.ts index 766d86fd46..f4e1fefef3 100644 --- a/packages/e2e-playwright/tests/e2e/vouchers/boleto/boleto.spec.ts +++ b/packages/e2e-playwright/tests/e2e/vouchers/boleto/boleto.spec.ts @@ -1,75 +1,31 @@ -import { test } from '@playwright/test'; +import { test as base, expect } from '@playwright/test'; +import Boleto from '../../../../models/boleto'; +import { URL_MAP } from '../../../../fixtures/URL_MAP'; -const getComponentData = () => { - return globalThis.boletoInput.data; +type Fixture = { + boleto: Boleto; }; -const mockData = { - shopperName: { - firstName: 'Tom', - lastName: 'Jobim' - }, - socialSecurityNumber: '32553325916', - billingAddress: { - country: 'BR', - street: 'Fake street', - houseNumberOrName: '123', - city: 'Sao Paulo', - postalCode: '11111555', - stateOrProvince: 'SP' - }, - shopperEmail: 'shopper@adyen.nl' -}; +const test = base.extend({ + boleto: async ({ page }, use) => { + const boleto = new Boleto(page); + await boleto.goto(URL_MAP.boleto); + await use(boleto); + } +}); -async function fillBoleto(t) { - // await t - // .typeText('.boleto-input .adyen-checkout__field--firstName .adyen-checkout__input', mockData.shopperName.firstName) - // .typeText('.boleto-input .adyen-checkout__field--lastName .adyen-checkout__input', mockData.shopperName.lastName) - // .typeText('.boleto-input .adyen-checkout__field--socialSecurityNumber .adyen-checkout__input', mockData.socialSecurityNumber) - // .typeText('.boleto-input .adyen-checkout__input--street', mockData.billingAddress.street) - // .typeText('.boleto-input .adyen-checkout__input--houseNumberOrName', mockData.billingAddress.houseNumberOrName) - // .typeText('.boleto-input .adyen-checkout__input--city', mockData.billingAddress.city) - // .typeText('.boleto-input .adyen-checkout__input--postalCode', mockData.billingAddress.postalCode) - // .click(Selector('.boleto-input .adyen-checkout__field--stateOrProvince .adyen-checkout__dropdown__button')) - // .click(Selector('.boleto-input [data-value=SP]')); -} +test('should make a Boleto payment', async ({ boleto, page }) => { + await boleto.personalDetails.firstNameInput.fill('Jose'); + await boleto.personalDetails.lastNameInput.fill('Fernandez'); + await boleto.personalDetails.socialSecurityNumberInput.fill('56861752509'); -test('should make a Boleto payment', async () => { - // await fillBoleto(t); - // const stateData = await getComponentData(); - // - // await t - // .expect(stateData.paymentMethod.type) - // .eql('boletobancario') - // .expect(stateData.shopperName) - // .eql(mockData.shopperName) - // .expect(stateData.socialSecurityNumber) - // .eql(mockData.socialSecurityNumber) - // .expect(stateData.billingAddress) - // .eql(mockData.billingAddress) - // .expect(getIsValid('boletoInput')) - // .eql(true); -}); + await boleto.billingAddress.streetInput.fill('Main St'); + await boleto.billingAddress.houseNumberInput.fill('1'); + await boleto.billingAddress.postalCodeInput.fill('13010111'); + await boleto.billingAddress.cityInput.fill('Capital'); + await boleto.billingAddress.selectState({ name: 'São Paulo' }); -test('should not submit a Boleto payment if the form in not valid', async () => {}); + await boleto.pay({ name: 'Generate Boleto' }); -test('should allow shoppers to send a copy to their email and make a Boleto payment', async () => { - // await fillBoleto(t); - // await t.expect(getIsValid('boletoInput')).eql(true); - // - // await t.click(Selector('.boleto-input .adyen-checkout__field--sendCopyToEmail .adyen-checkout__checkbox')); - // await t.expect(getIsValid('boletoInput')).eql(false); - // - // await t.typeText('.boleto-input .adyen-checkout__input--email', mockData.shopperEmail); - // await t.expect(getIsValid('boletoInput')).eql(true); - // - // const stateData = await getComponentData(); - // - // await t - // .expect(stateData.paymentMethod.type) - // .eql('boletobancario') - // .expect(stateData.shopperEmail) - // .eql(mockData.shopperEmail) - // .expect(getIsValid('boletoInput')) - // .eql(true); + await expect(boleto.barcodeLocator).toBeVisible(); }); diff --git a/packages/lib/config/jest.config.cjs b/packages/lib/config/jest.config.cjs index d360923ead..0f04b1a432 100644 --- a/packages/lib/config/jest.config.cjs +++ b/packages/lib/config/jest.config.cjs @@ -1,5 +1,5 @@ module.exports = { - testEnvironment: 'jsdom', + testEnvironment: 'jest-fixed-jsdom', verbose: true, rootDir: '../', setupFilesAfterEnv: ['/config/setupTests.ts'], @@ -10,10 +10,6 @@ module.exports = { moduleNameMapper: { '\\.scss$': '/config/testMocks/styleMock.js' }, - collectCoverageFrom: [ - 'src/**/*.{ts,tsx}', - '!src/**/types.ts', - '!src/language/locales/**' - ], + collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/types.ts', '!src/language/locales/**'], coveragePathIgnorePatterns: ['node_modules/', 'config/', 'scripts/', 'storybook/', '.storybook/', 'auto/', '_'] }; diff --git a/packages/lib/package.json b/packages/lib/package.json index 1fc4f8840c..ca3f70c1f8 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -119,8 +119,10 @@ "husky": "9.1.1", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", + "jest-fixed-jsdom": "^0.0.9", "jest-mock-extended": "3.0.7", "lint-staged": "15.2.7", + "msw": "^2.6.4", "postcss": "8.4.39", "rollup": "4.22.4", "rollup-plugin-dts": "6.1.1", @@ -137,8 +139,8 @@ "typescript": "5.5.3", "typescript-eslint": "7.16.1", "vite": "5.3.6", - "vite-plugin-stylelint": "5.3.1", "vite-plugin-static-copy": "1.0.6", + "vite-plugin-stylelint": "5.3.1", "whatwg-fetch": "3.6.20" }, "dependencies": { diff --git a/packages/lib/src/components/Boleto/Boleto.test.ts b/packages/lib/src/components/Boleto/Boleto.test.ts new file mode 100644 index 0000000000..7bd48e8f1b --- /dev/null +++ b/packages/lib/src/components/Boleto/Boleto.test.ts @@ -0,0 +1,191 @@ +import Boleto from './Boleto'; +import { render, screen } from '@testing-library/preact'; +import userEvent from '@testing-library/user-event'; +import { http, HttpResponse } from 'msw'; +import { setupServer } from 'msw/node'; + +const server = setupServer( + http.get('https://checkoutshopper-live.adyen.com/checkoutshopper/datasets/countries/en-US.json', () => { + return HttpResponse.json([{ id: 'BR', name: 'Brazil' }]); + }), + http.get('https://checkoutshopper-live.adyen.com/checkoutshopper/datasets/states/BR/en-US.json', () => { + return HttpResponse.json([ + { id: 'MG', name: 'Minas Gerais' }, + { id: 'SP', name: 'Sao Paulo' } + ]); + }) +); + +beforeAll(() => server.listen()); +afterEach(() => server.resetHandlers()); +afterAll(() => server.close()); + +describe('Boleto', () => { + test('should make a Boleto payment', async () => { + const user = userEvent.setup(); + + const onSubmitMock = jest.fn(); + + const boleto = new Boleto(global.core, { + modules: { analytics: global.analytics, resources: global.resources }, + i18n: global.i18n, + onSubmit: onSubmitMock, + loadingContext: 'https://checkoutshopper-live.adyen.com/checkoutshopper/' + }); + + render(boleto.render()); + + const firstNameInput = await screen.findByLabelText('First name'); + const lastNameInput = await screen.findByLabelText('Last name'); + const ssnInput = await screen.findByLabelText('CPF/CNPJ'); + const street = await screen.findByLabelText('Street'); + const houseNumber = await screen.findByLabelText('House number'); + const postalCode = await screen.findByLabelText('Postal code'); + const city = await screen.findByLabelText('City'); + const state = await screen.findByLabelText('State'); + + await user.type(firstNameInput, 'Jose'); + await user.type(lastNameInput, 'Fernandez'); + await user.type(ssnInput, '364.977.983-82'); + await user.type(street, 'Avenida Paulista'); + await user.type(houseNumber, '182'); + await user.type(postalCode, '01311-920'); + await user.type(city, 'Sao Paulo'); + + await user.click(state); + await user.keyboard('[ArrowDown][Enter]'); + + const button = await screen.findByRole('button', { name: 'Generate Boleto' }); + await user.click(button); + + expect(onSubmitMock).toHaveBeenCalledTimes(1); + expect(onSubmitMock).toHaveBeenCalledWith( + expect.objectContaining({ + data: { + paymentMethod: { + type: 'boletobancario', + checkoutAttemptId: 'fetch-checkoutAttemptId-failed' + }, + billingAddress: { + city: 'Sao Paulo', + country: 'BR', + houseNumberOrName: '182', + postalCode: '01311-920', + stateOrProvince: 'MG', + street: 'Avenida Paulista' + }, + shopperName: { + firstName: 'Jose', + lastName: 'Fernandez' + }, + socialSecurityNumber: '36497798382', + clientStateDataIndicator: true + } + }), + expect.anything(), + expect.anything() + ); + }); + + test('should not submit a Boleto payment if the form in not valid', async () => { + const user = userEvent.setup(); + + const onSubmitMock = jest.fn(); + + const boleto = new Boleto(global.core, { + modules: { analytics: global.analytics, resources: global.resources }, + i18n: global.i18n, + onSubmit: onSubmitMock, + loadingContext: 'https://checkoutshopper-live.adyen.com/checkoutshopper/' + }); + + render(boleto.render()); + + const button = await screen.findByRole('button', { name: 'Generate Boleto' }); + await user.click(button); + + expect(onSubmitMock).toHaveBeenCalledTimes(0); + + expect(screen.getByText('Enter your first name')).toBeInTheDocument(); + expect(screen.getByText('Enter your last name')).toBeInTheDocument(); + expect(screen.getByText('Enter a valid CPF/CNPJ number')).toBeInTheDocument(); + expect(screen.getByText('Enter the street')).toBeInTheDocument(); + expect(screen.getByText('Enter the house number')).toBeInTheDocument(); + expect(screen.getByText('Enter the postal code')).toBeInTheDocument(); + expect(screen.getByText('Enter the city')).toBeInTheDocument(); + expect(screen.getByText('Enter the state')).toBeInTheDocument(); + }); + + test('should allow shoppers to send a copy to their email and make a Boleto payment', async () => { + const user = userEvent.setup(); + + const onSubmitMock = jest.fn(); + + const boleto = new Boleto(global.core, { + modules: { analytics: global.analytics, resources: global.resources }, + i18n: global.i18n, + onSubmit: onSubmitMock, + loadingContext: 'https://checkoutshopper-live.adyen.com/checkoutshopper/' + }); + + render(boleto.render()); + + const firstNameInput = await screen.findByLabelText('First name'); + const lastNameInput = await screen.findByLabelText('Last name'); + const ssnInput = await screen.findByLabelText('CPF/CNPJ'); + const street = await screen.findByLabelText('Street'); + const houseNumber = await screen.findByLabelText('House number'); + const postalCode = await screen.findByLabelText('Postal code'); + const city = await screen.findByLabelText('City'); + const state = await screen.findByLabelText('State'); + + await user.type(firstNameInput, 'Jose'); + await user.type(lastNameInput, 'Fernandez'); + await user.type(ssnInput, '364.977.983-82'); + await user.type(street, 'Avenida Paulista'); + await user.type(houseNumber, '182'); + await user.type(postalCode, '01311-920'); + await user.type(city, 'Sao Paulo'); + + await user.click(state); + await user.keyboard('[ArrowDown][Enter]'); + + const emailCheckbox = await screen.findByRole('checkbox', { name: 'Send a copy to my email' }); + await user.click(emailCheckbox); + + const email = await screen.findByLabelText('Email address'); + await user.type(email, 'jose@adyen.com'); + + const button = await screen.findByRole('button', { name: 'Generate Boleto' }); + await user.click(button); + + expect(onSubmitMock).toHaveBeenCalledTimes(1); + expect(onSubmitMock).toHaveBeenCalledWith( + expect.objectContaining({ + data: { + paymentMethod: { + type: 'boletobancario', + checkoutAttemptId: 'fetch-checkoutAttemptId-failed' + }, + billingAddress: { + city: 'Sao Paulo', + country: 'BR', + houseNumberOrName: '182', + postalCode: '01311-920', + stateOrProvince: 'MG', + street: 'Avenida Paulista' + }, + shopperName: { + firstName: 'Jose', + lastName: 'Fernandez' + }, + shopperEmail: 'jose@adyen.com', + socialSecurityNumber: '36497798382', + clientStateDataIndicator: true + } + }), + expect.anything(), + expect.anything() + ); + }); +}); diff --git a/packages/lib/storybook/stories/vouchers/Boleto.stories.tsx b/packages/lib/storybook/stories/vouchers/Boleto.stories.tsx new file mode 100644 index 0000000000..85985246f4 --- /dev/null +++ b/packages/lib/storybook/stories/vouchers/Boleto.stories.tsx @@ -0,0 +1,25 @@ +import { MetaConfiguration, StoryConfiguration } from '../types'; +import { VoucherConfiguration } from '../../../src/components/types'; +import { ComponentContainer } from '../ComponentContainer'; +import Boleto from '../../../src/components/Boleto'; +import { Checkout } from '../Checkout'; + +type BoletoStory = StoryConfiguration; + +const meta: MetaConfiguration = { + title: 'Vouchers/Boleto' +}; + +export const Default: BoletoStory = { + render: ({ componentConfiguration, ...checkoutConfig }) => ( + + {checkout => } + + ), + + args: { + countryCode: 'BR' + } +}; + +export default meta; diff --git a/yarn.lock b/yarn.lock index d7b1248b55..6d006dbd54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -343,6 +343,28 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@bundled-es-modules/cookie@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz#b41376af6a06b3e32a15241d927b840a9b4de507" + integrity sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw== + dependencies: + cookie "^0.7.2" + +"@bundled-es-modules/statuses@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz#761d10f44e51a94902c4da48675b71a76cc98872" + integrity sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg== + dependencies: + statuses "^2.0.1" + +"@bundled-es-modules/tough-cookie@^0.1.6": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@bundled-es-modules/tough-cookie/-/tough-cookie-0.1.6.tgz#fa9cd3cedfeecd6783e8b0d378b4a99e52bde5d3" + integrity sha512-dvMHbL464C0zI+Yqxbz6kZ5TOEp7GLW+pry/RWndAR8MJQAXZ2rPmIs8tziTZjeIyhSNZgZbCePtfSbdWqStJw== + dependencies: + "@types/tough-cookie" "^4.0.5" + tough-cookie "^4.1.4" + "@changesets/apply-release-plan@^7.0.4": version "7.0.4" resolved "https://registry.yarnpkg.com/@changesets/apply-release-plan/-/apply-release-plan-7.0.4.tgz#f963e11848efa24c53abd10713662f2012b6082b" @@ -926,6 +948,39 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.0.tgz#6d86b8cb322660f03d3f0aa94b99bdd8e172d570" integrity sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew== +"@inquirer/confirm@^5.0.0": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-5.0.2.tgz#2b9dcf6b7da5f518c74abe4aeaf3173253d83c93" + integrity sha512-KJLUHOaKnNCYzwVbryj3TNBxyZIrr56fR5N45v6K9IPrbT6B7DcudBMfylkV1A8PUdJE15mybkEQyp2/ZUpxUA== + dependencies: + "@inquirer/core" "^10.1.0" + "@inquirer/type" "^3.0.1" + +"@inquirer/core@^10.1.0": + version "10.1.0" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-10.1.0.tgz#c5fdc34c4cafd7248da29a3c3b3120fe6e1c45be" + integrity sha512-I+ETk2AL+yAVbvuKx5AJpQmoaWhpiTFOg/UJb7ZkMAK4blmtG8ATh5ct+T/8xNld0CZG/2UhtkdMwpgvld92XQ== + dependencies: + "@inquirer/figures" "^1.0.8" + "@inquirer/type" "^3.0.1" + ansi-escapes "^4.3.2" + cli-width "^4.1.0" + mute-stream "^2.0.0" + signal-exit "^4.1.0" + strip-ansi "^6.0.1" + wrap-ansi "^6.2.0" + yoctocolors-cjs "^2.1.2" + +"@inquirer/figures@^1.0.8": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.8.tgz#d9e414a1376a331a0e71b151fea27c48845788b0" + integrity sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg== + +"@inquirer/type@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-3.0.1.tgz#619ce9f65c3e114d8e39c41822bed3440d20b478" + integrity sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A== + "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -1220,6 +1275,18 @@ dependencies: "@types/mdx" "^2.0.0" +"@mswjs/interceptors@^0.36.5": + version "0.36.10" + resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.36.10.tgz#028a51a3c01f6ed87679e972d9f12a9a3726f7a0" + integrity sha512-GXrJgakgJW3DWKueebkvtYgGKkxA7s0u5B0P5syJM5rvQUnrpLPigvci8Hukl7yEM+sU06l+er2Fgvx/gmiRgg== + dependencies: + "@open-draft/deferred-promise" "^2.2.0" + "@open-draft/logger" "^0.3.0" + "@open-draft/until" "^2.0.0" + is-node-process "^1.2.0" + outvariant "^1.4.3" + strict-event-emitter "^0.5.1" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1241,6 +1308,24 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@open-draft/deferred-promise@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz#4a822d10f6f0e316be4d67b4d4f8c9a124b073bd" + integrity sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA== + +"@open-draft/logger@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@open-draft/logger/-/logger-0.3.0.tgz#2b3ab1242b360aa0adb28b85f5d7da1c133a0954" + integrity sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ== + dependencies: + is-node-process "^1.2.0" + outvariant "^1.4.0" + +"@open-draft/until@^2.0.0", "@open-draft/until@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-2.1.0.tgz#0acf32f470af2ceaf47f095cdecd40d68666efda" + integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg== + "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -2080,6 +2165,11 @@ dependencies: "@types/node" "*" +"@types/cookie@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" + integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== + "@types/eslint@*": version "8.56.10" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.10.tgz#eb2370a73bf04a901eeba8f22595c7ee0f7eb58d" @@ -2325,7 +2415,12 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== -"@types/tough-cookie@*": +"@types/statuses@^2.0.4": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@types/statuses/-/statuses-2.0.5.tgz#f61ab46d5352fd73c863a1ea4e1cef3b0b51ae63" + integrity sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A== + +"@types/tough-cookie@*", "@types/tough-cookie@^4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== @@ -2747,7 +2842,7 @@ ansi-colors@^4.1.1, ansi-colors@^4.1.3: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== -ansi-escapes@^4.2.1: +ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -3470,6 +3565,11 @@ cli-truncate@^4.0.0: slice-ansi "^5.0.0" string-width "^7.0.0" +cli-width@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5" + integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ== + cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -3648,6 +3748,11 @@ cookie@0.6.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== +cookie@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" + integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== + core-js-pure@^3.25.3: version "3.37.1" resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.37.1.tgz#2b4b34281f54db06c9a9a5bd60105046900553bd" @@ -5655,6 +5760,11 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== +graphql@^16.8.1: + version "16.9.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f" + integrity sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw== + handle-thing@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" @@ -5737,6 +5847,11 @@ he@1.2.0, he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== +headers-polyfill@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/headers-polyfill/-/headers-polyfill-4.0.3.tgz#922a0155de30ecc1f785bcf04be77844ca95ad07" + integrity sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ== + hpack.js@^2.1.6: version "2.1.6" resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" @@ -6215,6 +6330,11 @@ is-negative-zero@^2.0.3: resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== +is-node-process@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-node-process/-/is-node-process-1.2.0.tgz#ea02a1b90ddb3934a19aea414e88edef7e11d134" + integrity sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw== + is-number-object@^1.0.4: version "1.0.7" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" @@ -6593,6 +6713,11 @@ jest-environment-node@^29.7.0: jest-mock "^29.7.0" jest-util "^29.7.0" +jest-fixed-jsdom@^0.0.9: + version "0.0.9" + resolved "https://registry.yarnpkg.com/jest-fixed-jsdom/-/jest-fixed-jsdom-0.0.9.tgz#12d594d3edfdd2ae09fd1f6c6c4e68baf4c4a1a7" + integrity sha512-KPfqh2+sn5q2B+7LZktwDcwhCpOpUSue8a1I+BcixWLOQoEVyAjAGfH+IYZGoxZsziNojoHGRTC8xRbB1wDD4g== + jest-get-type@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" @@ -7478,6 +7603,30 @@ ms@2.1.3, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +msw@^2.6.4: + version "2.6.4" + resolved "https://registry.yarnpkg.com/msw/-/msw-2.6.4.tgz#954906f10f23d9364529eebe9b4e244796241a8a" + integrity sha512-Pm4LmWQeytDsNCR+A7gt39XAdtH6zQb6jnIKRig0FlvYOn8eksn3s1nXxUfz5KYUjbckof7Z4p2ewzgffPoCbg== + dependencies: + "@bundled-es-modules/cookie" "^2.0.1" + "@bundled-es-modules/statuses" "^1.0.1" + "@bundled-es-modules/tough-cookie" "^0.1.6" + "@inquirer/confirm" "^5.0.0" + "@mswjs/interceptors" "^0.36.5" + "@open-draft/deferred-promise" "^2.2.0" + "@open-draft/until" "^2.1.0" + "@types/cookie" "^0.6.0" + "@types/statuses" "^2.0.4" + chalk "^4.1.2" + graphql "^16.8.1" + headers-polyfill "^4.0.2" + is-node-process "^1.2.0" + outvariant "^1.4.3" + path-to-regexp "^6.3.0" + strict-event-emitter "^0.5.1" + type-fest "^4.26.1" + yargs "^17.7.2" + multicast-dns@^7.2.5: version "7.2.5" resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-7.2.5.tgz#77eb46057f4d7adbd16d9290fa7299f6fa64cced" @@ -7486,6 +7635,11 @@ multicast-dns@^7.2.5: dns-packet "^5.2.2" thunky "^1.0.2" +mute-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-2.0.0.tgz#a5446fc0c512b71c83c44d908d5c7b7b4c493b2b" + integrity sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA== + nanoid@5.0.7, nanoid@^5.0.7: version "5.0.7" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-5.0.7.tgz#6452e8c5a816861fd9d2b898399f7e5fd6944cc6" @@ -7751,6 +7905,11 @@ outdent@^0.5.0: resolved "https://registry.yarnpkg.com/outdent/-/outdent-0.5.0.tgz#9e10982fdc41492bb473ad13840d22f9655be2ff" integrity sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q== +outvariant@^1.4.0, outvariant@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.4.3.tgz#221c1bfc093e8fec7075497e7799fdbf43d14873" + integrity sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA== + p-filter@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-filter/-/p-filter-2.1.0.tgz#1b1472562ae7a0f742f0f3d3d3718ea66ff9c09c" @@ -7942,6 +8101,11 @@ path-to-regexp@0.1.10: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== +path-to-regexp@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.3.0.tgz#2b6a26a337737a8e1416f9272ed0766b1c0389f4" + integrity sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ== + path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -9633,7 +9797,7 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -statuses@2.0.1: +statuses@2.0.1, statuses@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== @@ -9668,6 +9832,11 @@ streamx@^2.15.0, streamx@^2.18.0: optionalDependencies: bare-events "^2.2.0" +strict-event-emitter@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz#1602ece81c51574ca39c6815e09f1a3e8550bd93" + integrity sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ== + string-argv@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" @@ -10185,7 +10354,7 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tough-cookie@^4.1.2: +tough-cookie@^4.1.2, tough-cookie@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== @@ -10317,6 +10486,11 @@ type-fest@^2.19.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== +type-fest@^4.26.1: + version "4.26.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.26.1.tgz#a4a17fa314f976dd3e6d6675ef6c775c16d7955e" + integrity sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg== + type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -10879,6 +11053,15 @@ word-wrap@^1.2.5: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -11008,6 +11191,11 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== +yoctocolors-cjs@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz#f4b905a840a37506813a7acaa28febe97767a242" + integrity sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA== + zod@3.22.4: version "3.22.4" resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff"