generated from atls-lab/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,041 additions
and
762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 21 additions & 40 deletions
61
packages/payment-widget/integration/payment-widget.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,34 @@ | ||
import assert from 'node:assert/strict' | ||
import { it } from 'node:test' | ||
import { describe } from 'node:test' | ||
|
||
import { Input } from '@atls-ui-parts/input' | ||
import { Box } from '@atls-ui-parts/layout' | ||
import { render } from '@testing-library/react' | ||
import { screen } from '@testing-library/react' | ||
import React from 'react' | ||
|
||
import { LanguagesType } from '../src/index.js' | ||
import { Widget } from '../src/index.js' | ||
import { InputWrapper } from '../src/index.js' | ||
import { ButtonWrapper } from '../src/index.js' | ||
import 'global-jsdom/register' | ||
|
||
import assert from 'node:assert/strict' | ||
import { it } from 'node:test' | ||
import { describe } from 'node:test' | ||
|
||
import { render } from '@testing-library/react' | ||
import { fireEvent } from '@testing-library/react' | ||
import React from 'react' | ||
|
||
import { LanguagesType } from '../src/index.js' | ||
import { Widget } from '../src/index.js' | ||
import { InputWrapper } from '../src/index.js' | ||
import { AdditionalFieldsType } from '../src/index.js' | ||
|
||
const Form = ( | ||
<Widget | ||
settings={{ storeId: 'tinkoffTest', language: LanguagesType.RUSSIAN }} | ||
> | ||
<InputWrapper name={AdditionalFieldsType.Name}> | ||
{(props) => ( | ||
<Box flexDirection="column"> | ||
<Input {...props} placeholder="Name" /> | ||
</Box> | ||
)} | ||
</InputWrapper> | ||
<InputWrapper name={AdditionalFieldsType.Email}> | ||
{(props) => ( | ||
<Box flexDirection="column"> | ||
<Input {...props} placeholder="Email" /> | ||
</Box> | ||
)} | ||
</InputWrapper> | ||
<Widget settings={{ storeId: 'tinkoffTest', language: LanguagesType.RUSSIAN }} amount={1000}> | ||
<InputWrapper name={AdditionalFieldsType.Phone}> | ||
{(props) => ( | ||
<Box flexDirection="column"> | ||
<Input {...props} placeholder="Phone" /> | ||
</Box> | ||
)} | ||
{(props) => <input {...props} placeholder='Phone' />} | ||
</InputWrapper> | ||
</Widget> | ||
) | ||
|
||
describe('Payment Widget', () => { | ||
it('render', async () => { | ||
render(Form) | ||
const body = render(Form) | ||
|
||
const button = await body.findByRole('button') | ||
|
||
fireEvent.click(button) | ||
|
||
const button = await screen.findByRole('button') | ||
console.debug(button) | ||
assert.equal() | ||
assert.ok(button.innerHTML) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/payment-widget/src/interfaces/custom-fields.iterfaces.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
packages/payment-widget/src/interfaces/wrappers.interfaces.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
packages/payment-widget/src/ui/button/button.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.