Compare commits

...
Author SHA1 Message Date
bwallacee 81f497b4fa chore(trading): moving acs across 2023-11-21 11:05:58 +00:00
6 changed files with 39 additions and 39 deletions
+11 -37
View File
@@ -31,16 +31,17 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
cy.visit('/#/portfolio');
cy.get('[data-testid="pathname-/portfolio"]').should('exist');
// 1001-DEPO-001
// 1001-DEPO-002
// 1001-DEPO-003
// 1001-DEPO-005
// 1001-DEPO-006
// 1001-DEPO-007
// 1001-DEPO-008
// 1001-DEPO-009
// 1001-DEPO-010
/* must select the asset that I want to deposit (1001-DEPO-002)
should easily see the assets that I have a non-zero balance for (in the connected eth wallet)
should see the ERC20 token address of the asset
should see the Vega asset symbol
should see the Vega asset name */
// 1001-DEPO-009
// must see feedback on the deposit ETH transaction (1001-DEPO-009)
// 1001-DEPO-010
// must see feedback that the deposit has or has not been credited to the Vega key (1001-DEPO-010)
cy.getByTestId(depositsTab).click();
cy.getByTestId('deposit-button').click();
connectEthereumWallet('Unknown');
@@ -137,14 +138,9 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
it('can withdrawal', function () {
// 1002-WITH-0014
// 1002-WITH-006
// 1002-WITH-009
// 1002-WITH-011
// 1002-WITH-024
// 1002-WITH-012
// 1002-WITH-013
// 1002-WITH-014
// 1002-WITH-015
// 1002-WITH-016
// 1002-WITH-017
// 1002-WITH-019
@@ -237,28 +233,6 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
// cy.getByTestId('BALANCE_AVAILABLE_value').should('have.text', '6.999');
});
it('approved amount is less than deposit', function () {
// 1001-DEPO-006
// 1001-DEPO-007
cy.visit('/#/portfolio');
cy.get('[data-testid="pathname-/portfolio"]').should('exist');
cy.getByTestId(toastCloseBtn, txTimeout).click();
cy.getByTestId(depositsTab).click();
cy.getByTestId('deposit-button').click();
connectEthereumWallet('Unknown');
selectAsset(btcName);
cy.get('[data-testid="rich-select-option"]').eq(btcName).click();
cy.contains('Deposits of tBTC not approved').should('not.exist');
cy.contains('Use maximum').should('be.visible');
cy.get(amountField).clear().type('20000000');
cy.getByTestId(depositSubmit).should('be.visible');
cy.getByTestId(depositSubmit).click();
cy.getByTestId('input-error-text').should(
'contain.text',
`You can't deposit more than you have in your Ethereum wallet`
);
});
it('withdraw - delay verification', function () {
// 1001-DEPO-024
// 1002-WITH-007
+21 -2
View File
@@ -84,6 +84,19 @@ beforeEach(() => {
});
});
// Missing ACs
// 1001-DEPO-002
/* must select the asset that I want to deposit (1001-DEPO-002)
should easily see the assets that I have a non-zero balance for (in the connected eth wallet)
should see the ERC20 token address of the asset
should see the Vega asset symbol
should see the Vega asset name */
// 1001-DEPO-009
// must see feedback on the deposit ETH transaction (1001-DEPO-009)
// 1001-DEPO-010
// must see feedback that the deposit has or has not been credited to the Vega key (1001-DEPO-010)
describe('Deposit form', () => {
it('renders with default values', async () => {
render(<DepositForm {...props} />);
@@ -95,6 +108,7 @@ describe('Deposit form', () => {
);
expect(screen.getByLabelText('Asset')).toHaveValue('');
expect(screen.getByLabelText('To (Vega key)')).toHaveValue('');
// 1001-DEPO-003
expect(screen.getByLabelText('Amount')).toHaveValue(null);
});
@@ -104,6 +118,7 @@ describe('Deposit form', () => {
fireEvent.submit(screen.getByTestId('deposit-form'));
// 1001-DEPO-005
expect(props.submitDeposit).not.toHaveBeenCalled();
const validationMessages = await screen.findAllByRole('alert');
expect(validationMessages).toHaveLength(3);
@@ -120,7 +135,7 @@ describe('Deposit form', () => {
render(<DepositForm {...props} />);
fireEvent.submit(screen.getByTestId('deposit-form'));
// 1001-DEPO-001
expect(
await screen.findByText('Connect Ethereum wallet')
).toBeInTheDocument();
@@ -191,6 +206,8 @@ describe('Deposit form', () => {
});
fireEvent.submit(screen.getByTestId('deposit-form'));
// 1001-DEPO-006
// 1001-DEPO-007
expect(
await screen.findByText(
"You can't deposit more than your approved deposit amount, 30"
@@ -306,7 +323,8 @@ describe('Deposit form', () => {
});
fireEvent.click(screen.getByRole('button', { name: 'Deposit' }));
// 1001-DEPO-005
// 1001-DEPO-008
await waitFor(() => {
expect(props.submitDeposit).toHaveBeenCalledWith({
// @ts-ignore contract address definitely defined
@@ -314,6 +332,7 @@ describe('Deposit form', () => {
amount: '8',
vegaPublicKey: pubKey,
});
screen.debug();
});
});
@@ -60,6 +60,7 @@ it('Should perform the Ethereum transaction with the fetched approval', async ()
act(() => {
result.current.submit(withdrawalId);
});
// 1002-WITH-011
await waitFor(() => {
expect(mockPerform).toHaveBeenCalledWith(
erc20WithdrawalApproval.assetSource,
@@ -46,6 +46,7 @@ describe('Withdrawal form', () => {
render(<WithdrawForm {...props} />);
expect(screen.getByLabelText('Asset')).toHaveValue('');
// 1002-WITH-006
expect(screen.getByLabelText('To (Ethereum address)')).toHaveValue(
MOCK_ETH_ADDRESS
);
@@ -69,6 +69,7 @@ describe('WithdrawManager', () => {
);
await userEvent.type(screen.getByLabelText('Amount'), '0.01');
await userEvent.click(screen.getByTestId('submit-withdrawal'));
// 1002-WITH-009
expect(props.submit).toHaveBeenCalledWith({
amount: '1000',
asset: props.assets[0].id,
@@ -76,6 +76,10 @@ describe('Withdrawals', () => {
'Completed',
'0x1234…121314',
];
// 1002-WITH-012
// 1002-WITH-013
// 1002-WITH-014
// 1002-WITH-015
cells.forEach((cell, i) => {
expect(cell).toHaveTextContent(expectedValues[i]);
});