Merge remote-tracking branch 'origin/develop' into chore/2870-handle-market-data-gqlerrors
This commit is contained in:
@@ -115,7 +115,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "86666.297",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "71112.3321837696257405828",
|
||||
"locked_amount": "70934.5338131135920334533",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "86666.297",
|
||||
@@ -181,7 +181,7 @@
|
||||
"tranche_end": "2023-06-01T00:00:00.000Z",
|
||||
"total_added": "2500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "1545.241751882377",
|
||||
"locked_amount": "1534.9559294871795",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
@@ -568,8 +568,8 @@
|
||||
"tranche_start": "2023-02-01T00:00:00.000Z",
|
||||
"tranche_end": "2023-08-01T00:00:00.000Z",
|
||||
"total_added": "37500",
|
||||
"total_removed": "183.137181525",
|
||||
"locked_amount": "35944.80653391651375",
|
||||
"total_removed": "328.1417856",
|
||||
"locked_amount": "35789.666781767955",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "7500",
|
||||
@@ -587,6 +587,11 @@
|
||||
"amount": "183.137181525",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x326ded5446d14472f79d487ece43dd7db760fec5df52e310342930db38fb5de1"
|
||||
},
|
||||
{
|
||||
"amount": "145.004604075",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x6171eb144528a90bd3a51c6aacec83d4f40d63ffee5388a1c0b8318bee460042"
|
||||
}
|
||||
],
|
||||
"users": [
|
||||
@@ -606,11 +611,17 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 34,
|
||||
"tx": "0x326ded5446d14472f79d487ece43dd7db760fec5df52e310342930db38fb5de1"
|
||||
},
|
||||
{
|
||||
"amount": "145.004604075",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 34,
|
||||
"tx": "0x6171eb144528a90bd3a51c6aacec83d4f40d63ffee5388a1c0b8318bee460042"
|
||||
}
|
||||
],
|
||||
"total_tokens": "7500",
|
||||
"withdrawn_tokens": "183.137181525",
|
||||
"remaining_tokens": "7316.862818475"
|
||||
"withdrawn_tokens": "328.1417856",
|
||||
"remaining_tokens": "7171.8582144"
|
||||
},
|
||||
{
|
||||
"address": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
|
||||
@@ -635,7 +646,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "129999.45",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "71047.451128348659886215",
|
||||
"locked_amount": "70869.814976334411695805",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129999.45",
|
||||
@@ -701,7 +712,7 @@
|
||||
"tranche_end": "2023-09-03T00:00:00.000Z",
|
||||
"total_added": "62600",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "35415.06666032470672",
|
||||
"locked_amount": "35286.64098173515936",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "10000",
|
||||
@@ -894,7 +905,7 @@
|
||||
"tranche_end": "2023-09-17T00:00:00.000Z",
|
||||
"total_added": "5000",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "3020.4602676306445",
|
||||
"locked_amount": "3010.202625570776",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "5000",
|
||||
@@ -1105,7 +1116,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "97499.58",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "12913.1328103802082906612",
|
||||
"locked_amount": "12738.888292810260466596",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "97499.58",
|
||||
@@ -1138,7 +1149,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "135173.4239508",
|
||||
"total_removed": "98230.390980249184455396",
|
||||
"locked_amount": "17650.023192413700622871272848",
|
||||
"locked_amount": "17411.86101895660002567124812",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "135173.4239508",
|
||||
@@ -1184,7 +1195,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "32499.86",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "5432.3319754511083747504",
|
||||
"locked_amount": "5359.030315951306800194",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "32499.86",
|
||||
@@ -1217,7 +1228,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "10833.29",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "1768.171343907611431555",
|
||||
"locked_amount": "1744.312365042892135621",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "10833.29",
|
||||
@@ -1250,7 +1261,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "22749.93",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "6609.8193974640044998578",
|
||||
"locked_amount": "6520.629205660993410519",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "6500",
|
||||
@@ -1388,8 +1399,8 @@
|
||||
"tranche_start": "2022-11-01T00:00:00.000Z",
|
||||
"tranche_end": "2023-05-01T00:00:00.000Z",
|
||||
"total_added": "22500",
|
||||
"total_removed": "3995.28612255",
|
||||
"locked_amount": "10130.41983195211725",
|
||||
"total_removed": "4140.290726625",
|
||||
"locked_amount": "10037.335980662983125",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "7500",
|
||||
@@ -1418,6 +1429,11 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x3f253311d975a353930c10981b742ac3b0df52da085d437244f077b63ec32953"
|
||||
},
|
||||
{
|
||||
"amount": "145.004604075",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x8050aa26e1965d26aa350efbc83e48c1b95f8c0933f35dee35fbcdd43cb08dcc"
|
||||
},
|
||||
{
|
||||
"amount": "305.3119245",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -1499,6 +1515,12 @@
|
||||
"tranche_id": 33,
|
||||
"tx": "0x3f253311d975a353930c10981b742ac3b0df52da085d437244f077b63ec32953"
|
||||
},
|
||||
{
|
||||
"amount": "145.004604075",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 33,
|
||||
"tx": "0x8050aa26e1965d26aa350efbc83e48c1b95f8c0933f35dee35fbcdd43cb08dcc"
|
||||
},
|
||||
{
|
||||
"amount": "305.3119245",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -1561,8 +1583,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "7500",
|
||||
"withdrawn_tokens": "3995.28612255",
|
||||
"remaining_tokens": "3504.71387745"
|
||||
"withdrawn_tokens": "4140.290726625",
|
||||
"remaining_tokens": "3359.709273375"
|
||||
},
|
||||
{
|
||||
"address": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
|
||||
@@ -1587,7 +1609,7 @@
|
||||
"tranche_end": "2023-06-02T00:00:00.000Z",
|
||||
"total_added": "1939928.38",
|
||||
"total_removed": "928642.9598472029154",
|
||||
"locked_amount": "603203.9854527480689673466",
|
||||
"locked_amount": "599224.167263984014721592",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1852091.69",
|
||||
@@ -1938,7 +1960,7 @@
|
||||
"tranche_start": "2022-08-01T00:00:00.000Z",
|
||||
"tranche_end": "2023-02-01T00:00:00.000Z",
|
||||
"total_added": "42500",
|
||||
"total_removed": "24434.0787288",
|
||||
"total_removed": "30000",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -1953,6 +1975,11 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "5565.9212712",
|
||||
"user": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
|
||||
"tx": "0x1e37e1c281da391a5bb1ce5ad16cdcc78dba1cb97a1e46103dc4b07725f9ab9e"
|
||||
},
|
||||
{
|
||||
"amount": "1982.0652174",
|
||||
"user": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
|
||||
@@ -2001,6 +2028,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "5565.9212712",
|
||||
"user": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
|
||||
"tranche_id": 17,
|
||||
"tx": "0x1e37e1c281da391a5bb1ce5ad16cdcc78dba1cb97a1e46103dc4b07725f9ab9e"
|
||||
},
|
||||
{
|
||||
"amount": "1982.0652174",
|
||||
"user": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
|
||||
@@ -2027,8 +2060,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "30000",
|
||||
"withdrawn_tokens": "24434.0787288",
|
||||
"remaining_tokens": "5565.9212712"
|
||||
"withdrawn_tokens": "30000",
|
||||
"remaining_tokens": "0"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -33570,7 +33603,7 @@
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "3732368.4671",
|
||||
"total_removed": "592998.0503546212334",
|
||||
"locked_amount": "951415.83704816660962319369",
|
||||
"locked_amount": "945300.242117561097025888903",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1998.95815",
|
||||
@@ -34895,8 +34928,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "15870102.715470999700000001",
|
||||
"total_removed": "560497.18500562348693952",
|
||||
"locked_amount": "8673347.0570783123228140520127045570383887",
|
||||
"total_removed": "561830.98711463838793952",
|
||||
"locked_amount": "8651661.5501131125508179593874342593187349",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "16249.93",
|
||||
@@ -35475,6 +35508,16 @@
|
||||
"user": "0xE6CacAE56Cca8dFdB7910b5A13578719D4E57DA0",
|
||||
"tx": "0x86280b4d0cccc9e251d0f18fce5af974d0e1fb31a1aaf219725a27efb0d607f4"
|
||||
},
|
||||
{
|
||||
"amount": "718.26845",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
"tx": "0x71e2885c8c466c935c3fdcc7618896e149ebd155ff432f9c95b993c9f134547a"
|
||||
},
|
||||
{
|
||||
"amount": "615.533659014901",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x61b0366935b55d5f021bbf4c0e1c7595e1a8628fe24c135e62e66d82dc9cc021"
|
||||
},
|
||||
{
|
||||
"amount": "858.360074993579125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -37100,6 +37143,12 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0xb6a33b8b8855789fbc2d0f9545ba5c2258e52f143d90bc75bbe2411bd2f9b4a5"
|
||||
},
|
||||
{
|
||||
"amount": "615.533659014901",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0x61b0366935b55d5f021bbf4c0e1c7595e1a8628fe24c135e62e66d82dc9cc021"
|
||||
},
|
||||
{
|
||||
"amount": "858.360074993579125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -38188,8 +38237,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "259998.8875",
|
||||
"withdrawn_tokens": "117484.092376092228875",
|
||||
"remaining_tokens": "142514.795123907771125"
|
||||
"withdrawn_tokens": "118099.626035107129875",
|
||||
"remaining_tokens": "141899.261464892870125"
|
||||
},
|
||||
{
|
||||
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
|
||||
@@ -38849,6 +38898,12 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0x94fe358ee7c973dd1d28ca4c56250dfaccbcb718673872c8e9cf8651a22a1108"
|
||||
},
|
||||
{
|
||||
"amount": "718.26845",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
"tranche_id": 2,
|
||||
"tx": "0x71e2885c8c466c935c3fdcc7618896e149ebd155ff432f9c95b993c9f134547a"
|
||||
},
|
||||
{
|
||||
"amount": "1099.300488",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
@@ -39031,8 +39086,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "200000",
|
||||
"withdrawn_tokens": "90095.748006",
|
||||
"remaining_tokens": "109904.251994"
|
||||
"withdrawn_tokens": "90814.016456",
|
||||
"remaining_tokens": "109185.983544"
|
||||
},
|
||||
{
|
||||
"address": "0x1b956E6c00E238194B331eddEFF72Cb5f28A8d01",
|
||||
@@ -40384,8 +40439,8 @@
|
||||
"tranche_start": "2021-11-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-05-05T00:00:00.000Z",
|
||||
"total_added": "14597706.0446472999",
|
||||
"total_removed": "3921707.576409189114087282",
|
||||
"locked_amount": "2285733.39696055204772238928937325",
|
||||
"total_removed": "3922560.622544070958832032",
|
||||
"locked_amount": "2265713.475393546493807600671039882",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129284.449",
|
||||
@@ -40649,6 +40704,11 @@
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x0c292f2355b5cdc3b389ed35e6e138e593b1db9d91fcd58f132835343724bf90"
|
||||
},
|
||||
{
|
||||
"amount": "853.04613488184474475",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0xe2b3e0f908fa79636a02b919ede475f86857f0588badd6c85249eb97802fc331"
|
||||
},
|
||||
{
|
||||
"amount": "8950.14985089483210984",
|
||||
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
|
||||
@@ -43492,6 +43552,12 @@
|
||||
"tranche_id": 3,
|
||||
"tx": "0x0c292f2355b5cdc3b389ed35e6e138e593b1db9d91fcd58f132835343724bf90"
|
||||
},
|
||||
{
|
||||
"amount": "853.04613488184474475",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0xe2b3e0f908fa79636a02b919ede475f86857f0588badd6c85249eb97802fc331"
|
||||
},
|
||||
{
|
||||
"amount": "1192.05386354121365675",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
@@ -45882,8 +45948,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "359123.469575",
|
||||
"withdrawn_tokens": "302309.38363864041348675",
|
||||
"remaining_tokens": "56814.08593635958651325"
|
||||
"withdrawn_tokens": "303162.4297735222582315",
|
||||
"remaining_tokens": "55961.0398014777417685"
|
||||
},
|
||||
{
|
||||
"address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB",
|
||||
@@ -47221,7 +47287,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "5778205.3912159303",
|
||||
"total_removed": "2730068.739915456784546642",
|
||||
"locked_amount": "586203.563337309134341622543222115",
|
||||
"locked_amount": "578293.693508823362900678656754047",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "552496.6455",
|
||||
@@ -49204,7 +49270,7 @@
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "472355.6199999996",
|
||||
"total_removed": "32520.5457984892685",
|
||||
"locked_amount": "150757.26292676673422831001319128",
|
||||
"locked_amount": "149788.226930079775857648094063932",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "3000",
|
||||
|
||||
@@ -32,11 +32,14 @@ const usdcSymbol = 'fUSDC';
|
||||
const toastContent = 'toast-content';
|
||||
const ordersTab = 'Orders';
|
||||
const depositsTab = 'Deposits';
|
||||
const collateralTab = 'Collateral';
|
||||
const toastCloseBtn = 'toast-close';
|
||||
const price = '390';
|
||||
const size = '0.0005';
|
||||
const newPrice = '200';
|
||||
const completeWithdrawalBtn = 'complete-withdrawal';
|
||||
const submitTransferBtn = '[type="submit"]';
|
||||
const transferForm = 'transfer-form';
|
||||
|
||||
// Because the tests are run on a live network to optimize time, the tests are interdependent and must be run in the given order.
|
||||
describe('capsule - without MultiSign', { tags: '@slow' }, () => {
|
||||
@@ -105,12 +108,39 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('can key to key transfers', function () {
|
||||
cy.visit('/#/portfolio');
|
||||
cy.get('main[data-testid="/portfolio"]').should('exist');
|
||||
|
||||
cy.getByTestId(collateralTab).click();
|
||||
cy.getByTestId('open-transfer-dialog').click();
|
||||
cy.getByTestId('transfer-form').should('be.visible');
|
||||
cy.getByTestId('transfer-form').find('[name="toAddress"]').select(1);
|
||||
cy.get('select option')
|
||||
.contains('BTC')
|
||||
.invoke('index')
|
||||
.then((index) => {
|
||||
cy.get(assetSelectField).select(index, { force: true });
|
||||
});
|
||||
cy.getByTestId(transferForm)
|
||||
.find(amountField)
|
||||
.focus()
|
||||
.type('1', { delay: 100 });
|
||||
cy.getByTestId(transferForm).find(submitTransferBtn).click();
|
||||
cy.getByTestId(toastContent).should(
|
||||
'contain.text',
|
||||
'Transfer completeYour transaction has been confirmed TransferTo 7f9cf0…c255351.00 tBTC'
|
||||
);
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
});
|
||||
|
||||
it('can not withdrawal because of no MultiSign', function () {
|
||||
// 1002-WITH-022
|
||||
// 1002-WITH-023
|
||||
|
||||
cy.getByTestId('Withdrawals').click();
|
||||
cy.getByTestId('withdraw-dialog-button').click();
|
||||
connectEthereumWallet('Unknown');
|
||||
cy.get(assetSelectField, txTimeout).select(btcName, { force: true });
|
||||
cy.get(amountField).clear().type('1');
|
||||
cy.getByTestId('submit-withdrawal').click();
|
||||
@@ -118,7 +148,7 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
|
||||
'contain.text',
|
||||
'Funds unlocked'
|
||||
);
|
||||
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
cy.getByTestId('tab-withdrawals').within(() => {
|
||||
cy.get('.ag-center-cols-container')
|
||||
.children()
|
||||
@@ -135,6 +165,7 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
|
||||
'contain.text',
|
||||
'Error occurredprocessing response error'
|
||||
);
|
||||
cy.getByTestId(toastCloseBtn).click({ multiple: true });
|
||||
cy.getByTestId(completeWithdrawalBtn).should(
|
||||
'contain.text',
|
||||
'Complete withdrawal'
|
||||
@@ -227,8 +258,8 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('can edit order', function () {
|
||||
// comment because of bug #2695
|
||||
it.skip('can edit order', function () {
|
||||
cy.getByTestId(ordersTab).click();
|
||||
cy.getByTestId('edit').first().should('be.visible').click();
|
||||
cy.getByTestId('dialog-title').should('contain.text', 'Edit order');
|
||||
@@ -253,8 +284,8 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
checkIfDataAndTimeOfCreationAndUpdateIsEqual(orderUpdatedAt);
|
||||
});
|
||||
});
|
||||
|
||||
it('can cancel order', function () {
|
||||
// comment because of bug #2695
|
||||
it.skip('can cancel order', function () {
|
||||
cy.getByTestId(ordersTab).click();
|
||||
cy.getByTestId('cancel').first().click();
|
||||
cy.getByTestId(toastContent).should(
|
||||
@@ -301,7 +332,6 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
'contain.text',
|
||||
'Funds unlocked'
|
||||
);
|
||||
|
||||
cy.getByTestId('tab-withdrawals').within(() => {
|
||||
cy.get('.ag-center-cols-container')
|
||||
.children()
|
||||
@@ -318,8 +348,19 @@ describe('capsule', { tags: '@slow' }, () => {
|
||||
'contain.text',
|
||||
'Transaction confirmed'
|
||||
);
|
||||
cy.getByTestId(toastCloseBtn).click({ multiple: true });
|
||||
|
||||
cy.getByTestId(completeWithdrawalBtn).eq(0, txTimeout).should('not.exist');
|
||||
cy.wrap(null).then(() => {
|
||||
try {
|
||||
cy.getByTestId(completeWithdrawalBtn)
|
||||
.eq(0, txTimeout)
|
||||
.should('not.exist');
|
||||
} catch (error) {
|
||||
console.log(
|
||||
'Assertion failed, but we are continuing because this is our wait to complete transaction'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
cy.get('[col-id="txHash"]', txTimeout)
|
||||
.should('have.length.above', 1)
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
import { selectAsset } from '../support/helpers';
|
||||
|
||||
const formFieldError = 'input-error-text';
|
||||
const toAddressField = '[name="toAddress"]';
|
||||
const amountField = 'input[name="amount"]';
|
||||
const submitTransferBtn = '[type="submit"]';
|
||||
const transferForm = 'transfer-form';
|
||||
const errorText = 'input-error-text';
|
||||
const openTransferDialog = 'open-transfer-dialog';
|
||||
const closeDialog = 'dialog-close';
|
||||
const dialogTransferText = 'dialog-transfer-text';
|
||||
|
||||
const ASSET_SEPOLIA_TBTC = 2;
|
||||
const ASSET_EURO = 1;
|
||||
|
||||
const toastContent = 'toast-content';
|
||||
const collateralTab = 'Collateral';
|
||||
const toastCloseBtn = 'toast-close';
|
||||
|
||||
describe(
|
||||
'transfer form validation and transfer from options',
|
||||
{ tags: '@smoke' },
|
||||
() => {
|
||||
before(() => {
|
||||
cy.mockWeb3Provider();
|
||||
cy.mockTradingPage();
|
||||
cy.mockSubscription();
|
||||
cy.setVegaWallet();
|
||||
|
||||
cy.visit('/#/portfolio');
|
||||
cy.getByTestId(collateralTab).click();
|
||||
cy.getByTestId(openTransferDialog).click();
|
||||
|
||||
cy.wait('@Accounts');
|
||||
cy.wait('@Assets');
|
||||
});
|
||||
|
||||
it('empty fields', () => {
|
||||
cy.getByTestId(transferForm).find(submitTransferBtn).click();
|
||||
|
||||
cy.getByTestId(formFieldError).should('contain.text', 'Required');
|
||||
// only 2 despite 3 fields because the ethereum address will be auto populated
|
||||
cy.getByTestId(formFieldError).should('have.length', 3);
|
||||
});
|
||||
it('min amount', () => {
|
||||
// 1002-WITH-010
|
||||
selectAsset(ASSET_SEPOLIA_TBTC);
|
||||
cy.get(amountField).clear().type('0');
|
||||
cy.getByTestId(transferForm).find(submitTransferBtn).click();
|
||||
cy.getByTestId(errorText).should(
|
||||
'contain.text',
|
||||
'Value is below minimum'
|
||||
);
|
||||
});
|
||||
it('max amount', () => {
|
||||
selectAsset(ASSET_EURO); // Will be above maximum because the vega wallet doesn't have any collateral
|
||||
cy.get(amountField).clear().type('1001', { delay: 100 });
|
||||
cy.getByTestId(transferForm).find(submitTransferBtn).click();
|
||||
cy.getByTestId(errorText).should(
|
||||
'contain.text',
|
||||
'You cannot transfer more than your available collateral'
|
||||
);
|
||||
});
|
||||
|
||||
it('can start transfer from vega wallet', () => {
|
||||
cy.getByTestId(closeDialog).click();
|
||||
cy.getByTestId('manage-vega-wallet').click();
|
||||
cy.getByTestId('wallet-transfer').should('have.text', 'Transfer').click();
|
||||
cy.getByTestId(dialogTransferText).should(
|
||||
'contain.text',
|
||||
'Transfer funds to another Vega key from 02ecea…342f65 If you are at all unsure, stop and seek advice.'
|
||||
);
|
||||
});
|
||||
|
||||
it('can start transfer from trading collateral table', () => {
|
||||
cy.getByTestId(closeDialog).click();
|
||||
cy.getByTestId('Trading').first().click();
|
||||
cy.getByTestId(collateralTab).click();
|
||||
cy.getByTestId(openTransferDialog).click();
|
||||
cy.getByTestId(dialogTransferText).should(
|
||||
'contain.text',
|
||||
'Transfer funds to another Vega key from 02ecea…342f65 If you are at all unsure, stop and seek advice.'
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
describe('withdraw actions', { tags: '@regression' }, () => {
|
||||
beforeEach(() => {
|
||||
cy.mockWeb3Provider();
|
||||
cy.mockTradingPage();
|
||||
cy.mockSubscription();
|
||||
cy.setVegaWallet();
|
||||
|
||||
cy.visit('/#/portfolio');
|
||||
cy.getByTestId(collateralTab).click();
|
||||
cy.getByTestId(openTransferDialog).click();
|
||||
|
||||
cy.wait('@Accounts');
|
||||
cy.wait('@Assets');
|
||||
cy.mockVegaWalletTransaction();
|
||||
});
|
||||
|
||||
it('key to key transfers by select key', function () {
|
||||
cy.getByTestId(transferForm).should('be.visible');
|
||||
cy.getByTestId(transferForm).find(toAddressField).select(1);
|
||||
selectAsset(ASSET_SEPOLIA_TBTC);
|
||||
cy.getByTestId(transferForm).find(amountField).type('1', { delay: 100 });
|
||||
cy.getByTestId(transferForm).find(submitTransferBtn).click();
|
||||
cy.getByTestId(toastContent).should(
|
||||
'contain.text',
|
||||
'Awaiting confirmation'
|
||||
);
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
});
|
||||
|
||||
it('key to key transfers by enter manual key', function () {
|
||||
cy.getByTestId(transferForm).should('be.visible');
|
||||
cy.contains('Enter manually').click();
|
||||
cy.getByTestId(transferForm)
|
||||
.find(toAddressField)
|
||||
.type('7f9cf07d3a9905b1a61a1069f7a758855da428bc0f4a97de87f48644bfc25535');
|
||||
selectAsset(ASSET_SEPOLIA_TBTC);
|
||||
cy.getByTestId(transferForm).find(amountField).type('1', { delay: 100 });
|
||||
cy.getByTestId(transferForm).find(submitTransferBtn).click();
|
||||
cy.getByTestId(toastContent).should(
|
||||
'contain.text',
|
||||
'Awaiting confirmation'
|
||||
);
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
});
|
||||
});
|
||||
@@ -43,7 +43,11 @@ export const AccountsContainer = () => {
|
||||
</div>
|
||||
{!isReadOnly && (
|
||||
<div className="flex gap-2 justify-end p-2 px-[11px]">
|
||||
<Button size="sm" onClick={() => openTransferDialog()}>
|
||||
<Button
|
||||
size="sm"
|
||||
data-testid="open-transfer-dialog"
|
||||
onClick={() => openTransferDialog()}
|
||||
>
|
||||
{t('Transfer')}
|
||||
</Button>
|
||||
<Button size="sm" onClick={() => openDepositDialog()}>
|
||||
|
||||
@@ -185,7 +185,10 @@ export const VegaWalletConnectButton = () => {
|
||||
))}
|
||||
</DropdownMenuRadioGroup>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem onClick={() => openTransferDialog(true)}>
|
||||
<DropdownMenuItem
|
||||
data-testid="wallet-transfer"
|
||||
onClick={() => openTransferDialog(true)}
|
||||
>
|
||||
{t('Transfer')}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem data-testid="disconnect" onClick={disconnect}>
|
||||
|
||||
@@ -51,7 +51,7 @@ export const TransferContainer = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<p className="text-sm mb-4">
|
||||
<p className="text-sm mb-4" data-testid="dialog-transfer-text">
|
||||
{t('Transfer funds to another Vega key from')}{' '}
|
||||
<Lozenge className="font-mono">{truncateByChars(pubKey || '')}</Lozenge>{' '}
|
||||
{t('If you are at all unsure, stop and seek advice.')}
|
||||
|
||||
@@ -19,7 +19,10 @@ import type {
|
||||
OperationVariables,
|
||||
ApolloQueryResult,
|
||||
QueryOptions,
|
||||
ApolloError,
|
||||
} from '@apollo/client';
|
||||
import { GraphQLError } from 'graphql';
|
||||
|
||||
import type { Subscription, Observable } from 'zen-observable-ts';
|
||||
|
||||
type Item = {
|
||||
@@ -58,12 +61,16 @@ const query: Query<QueryData> = {
|
||||
};
|
||||
const subscriptionQuery: Query<SubscriptionData> = query;
|
||||
|
||||
const getData = jest.fn((r: QueryData | null) => r?.data || null);
|
||||
|
||||
const getDelta = jest.fn((r: SubscriptionData) => r.data);
|
||||
|
||||
const subscribe = makeDataProvider<QueryData, Data, SubscriptionData, Delta>({
|
||||
query,
|
||||
subscriptionQuery,
|
||||
update,
|
||||
getData: (r) => r?.data || null,
|
||||
getDelta: (r) => r.data,
|
||||
getData,
|
||||
getDelta,
|
||||
});
|
||||
|
||||
const combineData = jest.fn<
|
||||
@@ -91,8 +98,8 @@ const paginatedSubscribe = makeDataProvider<
|
||||
query,
|
||||
subscriptionQuery,
|
||||
update,
|
||||
getData: (r) => r?.data || null,
|
||||
getDelta: (r) => r.data,
|
||||
getData,
|
||||
getDelta,
|
||||
pagination: {
|
||||
first,
|
||||
append: defaultAppend,
|
||||
@@ -186,9 +193,20 @@ const clearPendingQueries = () => {
|
||||
};
|
||||
|
||||
describe('data provider', () => {
|
||||
beforeEach(() => {
|
||||
clearPendingQueries();
|
||||
callback.mockClear();
|
||||
getData.mockClear();
|
||||
clientQuery.mockClear();
|
||||
clientSubscribeUnsubscribe.mockClear();
|
||||
clientSubscribeSubscribe.mockClear();
|
||||
});
|
||||
it('memoize instance and unsubscribe if no subscribers', () => {
|
||||
const subscription1 = subscribe(jest.fn(), client);
|
||||
const subscription2 = subscribe(jest.fn(), client);
|
||||
const variables = { var: 'val' };
|
||||
const subscription1 = subscribe(jest.fn(), client, variables);
|
||||
const subscription2 = subscribe(jest.fn(), client, { ...variables });
|
||||
// const subscription1 = subscribe(jest.fn(), client);
|
||||
// const subscription2 = subscribe(jest.fn(), client);
|
||||
expect(clientSubscribeSubscribe.mock.calls.length).toEqual(1);
|
||||
subscription1.unsubscribe();
|
||||
expect(clientSubscribeUnsubscribe.mock.calls.length).toEqual(0);
|
||||
@@ -197,7 +215,6 @@ describe('data provider', () => {
|
||||
});
|
||||
|
||||
it('calls callback before and after initial fetch', async () => {
|
||||
callback.mockClear();
|
||||
const data: Item[] = [];
|
||||
const subscription = subscribe(callback, client);
|
||||
expect(callback.mock.calls.length).toBe(1);
|
||||
@@ -210,6 +227,49 @@ describe('data provider', () => {
|
||||
subscription.unsubscribe();
|
||||
});
|
||||
|
||||
it('calls callback on error', async () => {
|
||||
const subscription = subscribe(callback, client);
|
||||
expect(callback.mock.calls.length).toBe(1);
|
||||
expect(callback.mock.calls[0][0].data).toBe(null);
|
||||
expect(callback.mock.calls[0][0].loading).toBe(true);
|
||||
const error = new Error('Rejected by unit test');
|
||||
await rejectQuery(error);
|
||||
expect(getData).not.toBeCalled();
|
||||
expect(callback.mock.calls.length).toBe(2);
|
||||
expect(callback.mock.calls[1][0].error).toEqual(error);
|
||||
expect(callback.mock.calls[1][0].loading).toBe(false);
|
||||
subscription.unsubscribe();
|
||||
});
|
||||
|
||||
it('calls successful callback on NotFound error on party path', async () => {
|
||||
const subscription = subscribe(callback, client);
|
||||
expect(callback.mock.calls.length).toBe(1);
|
||||
expect(callback.mock.calls[0][0].data).toBe(null);
|
||||
expect(callback.mock.calls[0][0].loading).toBe(true);
|
||||
const error = new Error() as ApolloError;
|
||||
const graphQLError = new GraphQLError(
|
||||
'',
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
['party'],
|
||||
undefined,
|
||||
{
|
||||
type: 'NotFound',
|
||||
}
|
||||
);
|
||||
error.graphQLErrors = [graphQLError];
|
||||
const data: Data = [];
|
||||
getData.mockReturnValueOnce(data);
|
||||
await rejectQuery(error);
|
||||
expect(getData).toHaveBeenCalledWith(null, undefined);
|
||||
expect(callback.mock.calls.length).toBe(2);
|
||||
expect(callback.mock.calls[1][0].data).toEqual(data);
|
||||
expect(callback.mock.calls[1][0].error).toEqual(undefined);
|
||||
expect(callback.mock.calls[1][0].loading).toBe(false);
|
||||
subscription.unsubscribe();
|
||||
});
|
||||
|
||||
it('calls update and callback on each update', async () => {
|
||||
const data: Item[] = [];
|
||||
const subscription = subscribe(callback, client);
|
||||
@@ -228,8 +288,7 @@ describe('data provider', () => {
|
||||
subscription.unsubscribe();
|
||||
});
|
||||
|
||||
it("don't calls callback on update if data doesn't", async () => {
|
||||
callback.mockClear();
|
||||
it("don't calls callback on update if data doesn't change", async () => {
|
||||
const data: Item[] = [];
|
||||
const subscription = subscribe(callback, client);
|
||||
await resolveQuery({ data });
|
||||
@@ -247,10 +306,6 @@ describe('data provider', () => {
|
||||
});
|
||||
|
||||
it('refetch data on reload', async () => {
|
||||
clearPendingQueries();
|
||||
clientQuery.mockClear();
|
||||
clientSubscribeUnsubscribe.mockClear();
|
||||
clientSubscribeSubscribe.mockClear();
|
||||
const data: Item[] = [];
|
||||
const subscription = subscribe(callback, client);
|
||||
await resolveQuery({ data });
|
||||
@@ -263,9 +318,6 @@ describe('data provider', () => {
|
||||
});
|
||||
|
||||
it('refetch data and restart subscription on reload with force', async () => {
|
||||
clientQuery.mockClear();
|
||||
clientSubscribeUnsubscribe.mockClear();
|
||||
clientSubscribeSubscribe.mockClear();
|
||||
const data: Item[] = [];
|
||||
const subscription = subscribe(callback, client);
|
||||
await resolveQuery({ data });
|
||||
@@ -278,7 +330,6 @@ describe('data provider', () => {
|
||||
});
|
||||
|
||||
it('calls callback on flush', async () => {
|
||||
callback.mockClear();
|
||||
const data: Item[] = [];
|
||||
const subscription = subscribe(callback, client);
|
||||
await resolveQuery({ data });
|
||||
@@ -289,8 +340,6 @@ describe('data provider', () => {
|
||||
});
|
||||
|
||||
it('fills data with nulls if pagination is enabled', async () => {
|
||||
callback.mockClear();
|
||||
clearPendingQueries();
|
||||
const totalCount = 1000;
|
||||
const data: Item[] = new Array(first).fill(null).map((v, i) => ({
|
||||
cursor: i.toString(),
|
||||
@@ -311,7 +360,6 @@ describe('data provider', () => {
|
||||
});
|
||||
|
||||
it('loads requested data blocks and inserts data with total count', async () => {
|
||||
callback.mockClear();
|
||||
const totalCount = 1000;
|
||||
const subscription = paginatedSubscribe(callback, client);
|
||||
await resolveQuery({
|
||||
@@ -436,7 +484,6 @@ describe('data provider', () => {
|
||||
});
|
||||
|
||||
it('loads requested data blocks and inserts data without totalCount', async () => {
|
||||
callback.mockClear();
|
||||
const totalCount = undefined;
|
||||
const subscription = paginatedSubscribe(callback, client);
|
||||
await resolveQuery({
|
||||
|
||||
@@ -426,6 +426,15 @@ function makeDataProviderInternal<
|
||||
}
|
||||
};
|
||||
|
||||
const onError = (e: Error) => {
|
||||
error = e;
|
||||
if (subscription) {
|
||||
subscription.unsubscribe();
|
||||
subscription = undefined;
|
||||
}
|
||||
notifyAll();
|
||||
};
|
||||
|
||||
const initialize = async () => {
|
||||
if (subscription) {
|
||||
if (resetTimer) {
|
||||
@@ -446,14 +455,7 @@ function makeDataProviderInternal<
|
||||
variables,
|
||||
fetchPolicy,
|
||||
})
|
||||
.subscribe(onNext, (e) => {
|
||||
error = e as Error;
|
||||
if (subscription) {
|
||||
subscription.unsubscribe();
|
||||
subscription = undefined;
|
||||
}
|
||||
notifyAll();
|
||||
});
|
||||
.subscribe(onNext, onError);
|
||||
}
|
||||
await initialFetch();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user