Skip to content

Commit

Permalink
fix: ensure closing vaults after liquidation reconstitution
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Oct 15, 2024
1 parent 498369e commit 58e5284
Showing 1 changed file with 35 additions and 39 deletions.
74 changes: 35 additions & 39 deletions test/e2e/specs/liquidation-reconstitution.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,35 @@ describe('Liquidation Reconstitution Testing', () => {
});
});

context('Close reconstituted Vaults - TESTNET(s)', () => {
it('should close the 100 IST vault and approve the transaction successfully', () => {
cy.skipWhen(AGORIC_NET === networks.LOCAL);
cy.wait(QUICK_WAIT);
const regexVault100 = new RegExp('100(\\.\\d+)?');
cy.contains(regexVault100, { timeout: DEFAULT_TIMEOUT }).click();
cy.contains('Close Out Vault').click();
cy.contains('button', 'Close Out Vault').click();

cy.confirmTransaction().then(taskCompleted => {
expect(taskCompleted).to.be.true;
cy.contains('button', 'Close Out Vault').should('not.exist');
});
});

it('should close the 103 IST vault and approve the transaction successfully', () => {
cy.skipWhen(AGORIC_NET === networks.LOCAL);
const regexVault103 = new RegExp('103(\\.\\d+)?');
cy.contains(regexVault103, { timeout: DEFAULT_TIMEOUT }).click();
cy.contains('Close Out Vault').click();
cy.contains('button', 'Close Out Vault').click();

cy.confirmTransaction().then(taskCompleted => {
expect(taskCompleted).to.be.true;
cy.contains('button', 'Close Out Vault').should('not.exist');
});
});
});

context('Verification of Filled Bids', () => {
it("should see increase in the bidder's ATOM balance", () => {
const expectedValue = 13.585;
Expand Down Expand Up @@ -874,43 +903,10 @@ describe('Liquidation Reconstitution Testing', () => {
});
});

context(
'Close the vaults and restore ATOM price to 12.34 on TESTNET(s).',
() => {
it('should close the 100 IST vault and approve the transaction successfully', () => {
cy.skipWhen(AGORIC_NET === networks.LOCAL);
const regexVault100 = new RegExp('100(\\.\\d+)?');
cy.contains(regexVault100, { timeout: DEFAULT_TIMEOUT }).click();
cy.contains('Close Out Vault').click();
cy.contains('button.bg-interPurple', 'Close Out Vault').click();

cy.confirmTransaction().then(taskCompleted => {
expect(taskCompleted).to.be.true;
cy.contains('button.bg-interPurple', 'Close Out Vault').should(
'not.exist',
);
});
});

it('should close the 103 IST vault and approve the transaction successfully', () => {
cy.skipWhen(AGORIC_NET === networks.LOCAL);
const regexVault103 = new RegExp('103(\\.\\d+)?');
cy.contains(regexVault103, { timeout: DEFAULT_TIMEOUT }).click();
cy.contains('Close Out Vault').click();
cy.contains('button.bg-interPurple', 'Close Out Vault').click();

cy.confirmTransaction().then(taskCompleted => {
expect(taskCompleted).to.be.true;
cy.contains('button.bg-interPurple', 'Close Out Vault').should(
'not.exist',
);
});
});

it('should set ATOM price back to 12.34', () => {
cy.skipWhen(AGORIC_NET === networks.LOCAL);
cy.setOraclePrice(12.34);
});
},
);
context('Restore ATOM price to 12.34 on TESTNET(s).', () => {
it('should set ATOM price back to 12.34', () => {
cy.skipWhen(AGORIC_NET === networks.LOCAL);
cy.setOraclePrice(12.34);
});
});
});

0 comments on commit 58e5284

Please sign in to comment.