Add a test for the RBF page updates

This commit is contained in:
Felipe Knorr Kuhn 2025-04-02 19:26:46 +09:00
parent 9c4278834f
commit 05e407ff0f
No known key found for this signature in database
GPG Key ID: 79619B52BB097C1A
3 changed files with 142 additions and 0 deletions

View File

@ -561,6 +561,43 @@ describe('Mainnet', () => {
});
describe('RBF transactions', () => {
it('RBF page gets updated over websockets', () => {
cy.intercept('/api/v1/replacements', {
statusCode: 200,
body: []
});
cy.intercept('/api/v1/fullrbf/replacements', {
statusCode: 200,
body: []
});
cy.mockMempoolSocketV2();
cy.visit('/rbf');
cy.get('.no-replacements');
cy.get('.tree').should('have.length', 0);
receiveWebSocketMessageFromServer({
params: {
file: {
path: 'rbf_page/rbf_01.json'
}
}
});
cy.get('.tree').should('have.length', 1);
receiveWebSocketMessageFromServer({
params: {
file: {
path: 'rbf_page/rbf_02.json'
}
}
});
cy.get('.tree').should('have.length', 2);
});
it('shows RBF transactions properly (mobile - details)', () => {
cy.intercept('/api/v1/tx/21518a98d1aa9df524865d2f88c578499f524eb1d0c4d3e70312ab863508692f/cached', {
fixture: 'mainnet_tx_cached.json'

View File

@ -0,0 +1,37 @@
{
"rbfLatest": [
{
"tx": {
"txid": "f4bae4f626036250fd00d68490e572f65f66417452003a0f4c4d76f17a9fde68",
"fee": 1185,
"vsize": 223,
"value": 41729,
"rate": 5.313901345291479,
"time": 1743587177,
"rbf": true,
"fullRbf": false,
"mined": true
},
"time": 1743587177,
"fullRbf": true,
"replaces": [
{
"tx": {
"txid": "12945412dfc455e0ed6049dc2ee8737756c8d9e2d9a2eb26f366cd5019a0369f",
"fee": 504,
"vsize": 222,
"value": 42410,
"rate": 2.27027027027027,
"time": 1743586081,
"rbf": true
},
"time": 1743586081,
"interval": 1096,
"fullRbf": false,
"replaces": []
}
],
"mined": true
}
]
}

View File

@ -0,0 +1,68 @@
{
"rbfLatest": [
{
"tx": {
"txid": "d313b479acfbae719afb488a078e0fe0e052a67b9f65f73f7c75d3d95fd36acc",
"fee": 672,
"vsize": 167.25,
"value": 29996328,
"rate": 4.017937219730942,
"time": 1743587365,
"rbf": true,
"fullRbf": false
},
"time": 1743587365,
"fullRbf": false,
"replaces": [
{
"tx": {
"txid": "eb5aa786cabda307cc9642cfb9c41a3b405ac20a391eefbe54be7930bea61865",
"fee": 336,
"vsize": 167.5,
"value": 29996664,
"rate": 2.005970149253731,
"time": 1743586424,
"rbf": true
},
"time": 1743586424,
"interval": 941,
"fullRbf": false,
"replaces": []
}
]
},
{
"tx": {
"txid": "f4bae4f626036250fd00d68490e572f65f66417452003a0f4c4d76f17a9fde68",
"fee": 1185,
"vsize": 223,
"value": 41729,
"rate": 5.313901345291479,
"time": 1743587177,
"rbf": true,
"fullRbf": false,
"mined": true
},
"time": 1743587177,
"fullRbf": true,
"replaces": [
{
"tx": {
"txid": "12945412dfc455e0ed6049dc2ee8737756c8d9e2d9a2eb26f366cd5019a0369f",
"fee": 504,
"vsize": 222,
"value": 42410,
"rate": 2.27027027027027,
"time": 1743586081,
"rbf": true
},
"time": 1743586081,
"interval": 1096,
"fullRbf": false,
"replaces": []
}
],
"mined": true
}
]
}