Skip to content

Commit

Permalink
test: gov3 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Oct 28, 2024
1 parent 191417b commit 6f0b9da
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
89 changes: 89 additions & 0 deletions tests/e2e/specs/proposal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ describe('Make Proposal Tests', () => {
secretWords: networkPhrases.gov2Phrase,
walletName: 'gov2',
});
cy.setupWallet({
secretWords: networkPhrases.gov3Phrase,
walletName: 'gov3',
});
cy.setupWallet({
secretWords: networkPhrases.gov4Phrase,
walletName: 'gov4',
Expand Down Expand Up @@ -423,4 +427,89 @@ describe('Make Proposal Tests', () => {
});
});
});

context('Gov3 tests', () => {
it('should not allow gov3 to create a proposal', () => {
cy.switchWallet('gov3');
cy.reload();
cy.contains('button', 'PSM').click();
cy.get('button').contains('AUSD').click();
cy.get('button').contains(networkPhrases.token).click();

// Change mint limit and proposal time to 1 min
cy.get('label')
.contains('Set Mint Limit')
.parent()
.within(() => {
cy.get('input').spread(_ => {
cy.get('input').clear().type(900);
});
});
cy.get('label')
.contains('Minutes until close of vote')
.parent()
.within(() => {
cy.get('input').clear().type(networkPhrases.minutes);
});

cy.get('[value="Propose Parameter Change"]').should('be.disabled');
});

it('should allow gov1 to create a proposal', () => {
cy.switchWallet('gov1');
cy.reload();

// open Values and select manager 0
cy.get('button').contains('Vaults').click();
cy.get('button').contains('Select Manager').click();
cy.get('button').contains('manager0').click();

// Change debt limit and proposal time to 1 min
cy.get('label')
.contains('DebtLimit')
.parent()
.within(() => {
cy.get('input').spread(element => {
cy.get('input').clear().type(element.value);
});
});
cy.get('label')
.contains('Minutes until close of vote')
.parent()
.within(() => {
cy.get('input').clear().type(networkPhrases.minutes);
});
});

it(
'should confirm transaction for gov1 to create a proposal',
{
retries: {
runMode: txRetryCount,
},
},
() => {
cy.get('[value="Propose Parameter Change"]').click();

// Submit proposal and wait for confirmation
cy.confirmTransaction();
cy.get('p')
.contains('sent', { timeout: DEFAULT_TIMEOUT })
.should('be.visible')
.then(() => {
startTime = Date.now();
});
},
);

it('should not allow gov3 to vote on the proposal', () => {
cy.switchWallet('gov3');
cy.reload();

cy.contains(
'p',
'You must first have received an invitation to the Economic Committee',
);
});
});
});
5 changes: 5 additions & 0 deletions tests/e2e/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const phrasesList = {
networkConfigURL: 'https://emerynet.agoric.net/network-config',
gov1Phrase: Cypress.env('GOV1_PHRASE'),
gov2Phrase: Cypress.env('GOV2_PHRASE'),
gov3Phrase: Cypress.env('GOV4_PHRASE'),
gov4Phrase: Cypress.env('GOV3_PHRASE'),
},
devnet: {
Expand All @@ -19,6 +20,7 @@ export const phrasesList = {
networkConfigURL: 'https://devnet.agoric.net/network-config',
gov1Phrase: Cypress.env('GOV1_PHRASE'),
gov2Phrase: Cypress.env('GOV2_PHRASE'),
gov3Phrase: Cypress.env('GOV4_PHRASE'),
gov4Phrase: Cypress.env('GOV3_PHRASE'),
},
xnet: {
Expand All @@ -29,6 +31,7 @@ export const phrasesList = {
networkConfigURL: 'https://xnet.agoric.net/network-config',
gov1Phrase: Cypress.env('GOV1_PHRASE'),
gov2Phrase: Cypress.env('GOV2_PHRASE'),
gov3Phrase: Cypress.env('GOV4_PHRASE'),
gov4Phrase: Cypress.env('GOV3_PHRASE'),
},
local: {
Expand All @@ -40,6 +43,8 @@ export const phrasesList = {
'such field health riot cost kitten silly tube flash wrap festival portion imitate this make question host bitter puppy wait area glide soldier knee',
gov2Phrase:
'physical immune cargo feel crawl style fox require inhale law local glory cheese bring swear royal spy buyer diesel field when task spin alley',
gov3Phrase:
'spike siege world rather ordinary upper napkin voice brush oppose junior route trim crush expire angry seminar anchor panther piano image pepper chest alone',
gov4Phrase:
'tackle hen gap lady bike explain erode midnight marriage wide upset culture model select dial trial swim wood step scan intact what card symptom',
},
Expand Down

0 comments on commit 6f0b9da

Please sign in to comment.