From 6ec6c6b8b795d01ee0b5558e2cd6fea153396273 Mon Sep 17 00:00:00 2001
From: Dexter Edwards
Date: Tue, 11 Oct 2022 14:36:16 +0100
Subject: [PATCH] test: reintroduce tests that were failing (#1505)
---
apps/token/.env | 1 +
...roposal-form-vote-and-enactment-deadline.spec.tsx | 12 ++++--------
.../proposal-form-vote-and-enactment-deadline.tsx | 6 +++---
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/apps/token/.env b/apps/token/.env
index 64e281df9..94d8ef072 100644
--- a/apps/token/.env
+++ b/apps/token/.env
@@ -13,3 +13,4 @@ NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
#Test configuration variables
CYPRESS_FAIRGROUND=false
+LC_ALL="en_US.UTF-8"
diff --git a/apps/token/src/routes/governance/components/propose/proposal-form-vote-and-enactment-deadline.spec.tsx b/apps/token/src/routes/governance/components/propose/proposal-form-vote-and-enactment-deadline.spec.tsx
index f5030e6cb..139fd6d85 100644
--- a/apps/token/src/routes/governance/components/propose/proposal-form-vote-and-enactment-deadline.spec.tsx
+++ b/apps/token/src/routes/governance/components/propose/proposal-form-vote-and-enactment-deadline.spec.tsx
@@ -127,8 +127,7 @@ describe('Proposal form vote, validation and enactment deadline', () => {
expect(screen.getByTestId('validation-2-mins-extra')).toBeTruthy();
});
- // eslint-disable-next-line jest/no-disabled-tests
- it.skip('should show the correct datetimes', () => {
+ it('should show the correct datetimes', () => {
renderComponent();
// Should be adding 2 mins to the vote deadline as the minimum is set by
// default, and we add 2 mins for wallet confirmation
@@ -143,8 +142,7 @@ describe('Proposal form vote, validation and enactment deadline', () => {
);
});
- // eslint-disable-next-line jest/no-disabled-tests
- it.skip('should be updating every second, so show the correct datetimes when 30 seconds have passed', () => {
+ it('should be updating every second, so show the correct datetimes when 30 seconds have passed', () => {
renderComponent();
act(() => {
jest.advanceTimersByTime(30000);
@@ -161,8 +159,7 @@ describe('Proposal form vote, validation and enactment deadline', () => {
);
});
- // eslint-disable-next-line jest/no-disabled-tests
- it.skip('update the vote deadline date and the enactment deadline date when the vote deadline is changed', () => {
+ it('update the vote deadline date and the enactment deadline date when the vote deadline is changed', () => {
renderComponent();
const voteDeadlineInput = screen.getByTestId('proposal-vote-deadline');
fireEvent.change(voteDeadlineInput, { target: { value: 2 } });
@@ -174,8 +171,7 @@ describe('Proposal form vote, validation and enactment deadline', () => {
);
});
- // eslint-disable-next-line jest/no-disabled-tests
- it.skip('updates the validation deadline max and date when the vote deadline max is changed', () => {
+ it('updates the validation deadline max and date when the vote deadline max is changed', () => {
renderComponent();
const voteDeadlineMinButton = screen.getByTestId('min-vote');
const voteDeadlineMaxButton = screen.getByTestId('max-vote');
diff --git a/apps/token/src/routes/governance/components/propose/proposal-form-vote-and-enactment-deadline.tsx b/apps/token/src/routes/governance/components/propose/proposal-form-vote-and-enactment-deadline.tsx
index f09a7c5f5..de7a7d278 100644
--- a/apps/token/src/routes/governance/components/propose/proposal-form-vote-and-enactment-deadline.tsx
+++ b/apps/token/src/routes/governance/components/propose/proposal-form-vote-and-enactment-deadline.tsx
@@ -91,7 +91,7 @@ const ValidationForm = ({
{t('ThisWillSetValidationDeadlineTo')}
- {deadlineDates.validation?.toLocaleString()}
+ {deadlineDates.validation.toLocaleString()}
{deadlines.validation === 0 && (
- {deadlineDates.enactment?.toLocaleString()}
+ {deadlineDates.enactment.toLocaleString()}
)}
@@ -406,7 +406,7 @@ export const ProposalFormVoteAndEnactmentDeadline = ({
{t('ThisWillSetVotingDeadlineTo')}
- {deadlineDates.vote?.toLocaleString()}
+ {deadlineDates.vote.toLocaleString()}
{deadlines.vote === minVoteHours && (