Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cc60af7
feat: add logger injection helper function
kneerose Feb 20, 2025
c62c743
feat: integrate logger injection into Playwright test fixtures
kneerose Feb 20, 2025
4c27cdc
refactor: remove unused failureWithConsoleMessages function from exce…
kneerose Feb 20, 2025
06fec9e
chore(outcomes): upgrade outcomes package to latest version
emmanuel-musau Feb 18, 2025
e70f13d
chore(outcomes): sync yarn.lock changes
emmanuel-musau Feb 18, 2025
11aca6f
chore: import gov actions ui package dynamically
emmanuel-musau Feb 19, 2025
750c432
test: increase timeout for visibility assertions in delegation and pr…
kneerose Feb 20, 2025
4cf4450
fix: proposal reply flaky test by using testid instead if getBytext
kneerose Feb 21, 2025
dafa56c
feat: add proposal09Wallet and corresponding auth setup
kneerose Feb 21, 2025
6599be4
feat: add function to retrieve draft proposal wallet and state based …
kneerose Feb 21, 2025
6631e39
refactor: use any proposal in proposal tests & merge 7M into a generi…
kneerose Feb 21, 2025
2949276
fix: correct constitutional URL test ID and increase timeout for draf…
kneerose Feb 21, 2025
eed7195
fix: error logging on waited loop
kneerose Feb 21, 2025
8515b5c
fix: ensure Active checkbox unchecked when filtering with a single op…
kneerose Feb 21, 2025
d266be6
fix: delegated ada format
kneerose Feb 21, 2025
dd2fd25
fix: refactor transaction polling to use functionWaitedAssert for imp…
kneerose Feb 21, 2025
a37a880
fix: wrap with functionWaitedAssertion on queryParameters
kneerose Feb 21, 2025
bb36959
Merge pull request #3044 from IntersectMBO/feat/log-inject
mesudip Feb 21, 2025
a4e87fe
fix: resetting active filter in drep directory
MSzalowski Feb 21, 2025
68ba8e2
Merge pull request #3048 from IntersectMBO/fix/resetting-active-filte…
MSzalowski Feb 21, 2025
19df972
chore: update GovTool to v2.0.12
github-actions[bot] Feb 21, 2025
5e83a7d
Merge pull request #3049 from IntersectMBO/chore/update-govtool-to-v2…
MSzalowski Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ changes.

## [Unreleased]

### Added

### Fixed

### Changed

### Removed

## [v2.0.12](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.12) 2025-02-21


### Added

- Add metadata url and hash to drep details [Issue 2911](https://github.com/IntersectMBO/govtool/issues/2911)
Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.11/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.12/x/vva-be/build/vva-be/vva-be /usr/local/bin
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile.qovery
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.11/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.12/x/vva-be/build/vva-be/vva-be /usr/local/bin

# Expose the necessary port
EXPOSE 9876
Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/vva-be.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.6
name: vva-be
version: 2.0.11
version: 2.0.12

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
13 changes: 7 additions & 6 deletions govtool/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions govtool/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@govtool/frontend",
"private": true,
"version": "2.0.11",
"version": "2.0.12",
"type": "module",
"scripts": {
"build": "vite build",
Expand All @@ -27,7 +27,7 @@
"@emotion/styled": "^11.11.0",
"@emurgo/cardano-serialization-lib-asmjs": "^12.1.1",
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.0.0",
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.2.0",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "0.6.2",
"@mui/icons-material": "^5.14.3",
Expand Down
7 changes: 5 additions & 2 deletions govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
const [inProgressDelegationDRepData, setInProgressDelegationDRepData] =
useState<DRepData | undefined>(undefined);

useEffect(() => {
setChosenFilters([DRepStatus.Active]);
}, []);

useEffect(() => {
if (!chosenSorting) setChosenSorting(DRepListSort.Random);
if (!chosenFilters.length) setChosenFilters([DRepStatus.Active]);
}, [chosenSorting, setChosenSorting, chosenFilters, setChosenFilters]);
}, [chosenSorting, setChosenSorting]);

const { delegate, isDelegating } = useDelegateTodRep();

Expand Down
12 changes: 6 additions & 6 deletions govtool/frontend/src/pages/GovernanceActionOutComes.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import Outcomes from "@intersect.mbo/govtool-outcomes-pillar-ui";
import { Box, CircularProgress } from "@mui/material";
import { Suspense } from "react";
import React, { Suspense } from "react";
import { Footer, TopNav } from "@/components/organisms";
import { useCardano } from "@/context";
import { useScreenDimension } from "@/hooks";

const GovernanceActionsOutcomes = React.lazy(
() => import("@intersect.mbo/govtool-outcomes-pillar-ui/dist/esm"),
);

export const GovernanceActionOutComesPillar = () => {
const { pagePadding } = useScreenDimension();
const { ...context } = useCardano();
Expand Down Expand Up @@ -40,10 +43,7 @@ export const GovernanceActionOutComesPillar = () => {
</Box>
}
>
{/* TODO: Remove this comments when tsc issue is resolved */}
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-expect-error */}
<Outcomes description="" />
<GovernanceActionsOutcomes />
</Suspense>
</Box>
{!context.isEnabled && <Footer />}
Expand Down
10 changes: 10 additions & 0 deletions govtool/frontend/src/types/@intersect.mbo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,18 @@ type ProposalDiscussionProps = {
>;
};

type GovernanceActionsOutcomesProps = {
apiUrl?: string;
};

declare module "@intersect.mbo/pdf-ui/cjs" {
export default function ProposalDiscussion(
props: ProposalDiscussionProps,
): JSX.Element;
}

declare module "@intersect.mbo/govtool-outcomes-pillar-ui/dist/esm" {
export default function GovernanceActionsOutcomes(
props: GovernanceActionsOutcomesProps,
): JSX.Element;
}
8 changes: 4 additions & 4 deletions govtool/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1488,10 +1488,10 @@
resolved "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz"
integrity sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==

"@intersect.mbo/govtool-outcomes-pillar-ui@1.0.0":
version "1.0.0"
resolved "https://registry.npmjs.org/@intersect.mbo/govtool-outcomes-pillar-ui/-/govtool-outcomes-pillar-ui-1.0.0.tgz"
integrity sha512-rsg/F1q713hMQI7bc+rEHy5odIYl4KR9Za/U3X0jUE0trk/X6sVjwiSM0HPBQhervJOWKN8OtEzCaNstjk1zRg==
"@intersect.mbo/govtool-outcomes-pillar-ui@1.2.0":
version "1.2.0"
resolved "https://registry.npmjs.org/@intersect.mbo/govtool-outcomes-pillar-ui/-/govtool-outcomes-pillar-ui-1.2.0.tgz"
integrity sha512-AzY2pOAExXCz7M6S2YeIglZ06Gdf0N9gWxJBRDQ2BuDsRC2arn4DwT2F+XHyOhM2AWSZeql0Dx86a0pZP7a1+w==
dependencies:
"@fontsource/poppins" "^5.0.14"
"@intersect.mbo/intersectmbo.org-icons-set" "^1.0.8"
Expand Down
4 changes: 2 additions & 2 deletions govtool/metadata-validation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion govtool/metadata-validation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@govtool/metadata-validation",
"version": "2.0.11",
"version": "2.0.12",
"description": "",
"author": "",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion govtool/metadata-validation/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function bootstrap() {
const config = new DocumentBuilder()
.setTitle('Metadata Validation Tool')
.setDescription('The Metadata Validation Tool API description')
.setVersion('2.0.11')
.setVersion("2.0.12")
.build();

const document = SwaggerModule.createDocument(app, config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const proposal05Wallet: StaticWallet = staticWallets[14];
export const proposal06Wallet: StaticWallet = staticWallets[15];
export const proposal07Wallet: StaticWallet = staticWallets[16];
export const proposal08Wallet: StaticWallet = staticWallets[17];
export const proposal09Wallet: StaticWallet = staticWallets[18];

export const adaHolderWallets = [
adaHolder01Wallet,
Expand All @@ -48,6 +49,7 @@ export const proposalWallets = [
proposal06Wallet,
proposal07Wallet,
proposal08Wallet,
proposal09Wallet,
];

export const allStaticWallets = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { test as base } from "@playwright/test";
import { StaticWallet } from "@types";
import { importWallet } from "./importWallet";
import loadDemosExtension from "./loadExtension";
import { injectLogger } from "@helpers/page";

type WalletExtensionTestOptions = {
wallet?: StaticWallet;
Expand All @@ -25,6 +26,7 @@ export const test = base.extend<WalletExtensionTestOptions>({
if (wallet) {
await importWallet(page, wallet);
}
injectLogger(page);

await use(page);
},
Expand Down
9 changes: 9 additions & 0 deletions tests/govtool-frontend/playwright/lib/helpers/adaFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ export const correctVoteAdaFormat = (
}
return "0";
};

export const correctDelegatedVoteAdaFormat = (ada: number | undefined) => {
if (ada) {
return ada.toLocaleString("en-us", {
maximumFractionDigits: 3,
});
}
return "0";
};
35 changes: 33 additions & 2 deletions tests/govtool-frontend/playwright/lib/helpers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ import { valid as mockValid } from "@mock/index";
import LoginPage from "@pages/loginPage";
import ProposalDiscussionPage from "@pages/proposalDiscussionPage";
import { BrowserContext, Page } from "@playwright/test";
import { StaticWallet } from "@types";
import { ProposalType, StaticWallet } from "@types";
import { ShelleyWallet } from "./crypto";
import convertBufferToHex from "./convertBufferToHex";
import { updateWalletConfig } from "@fixtures/createWallet";
import { adaHolder05Wallet } from "@constants/staticWallets";
import {
adaHolder05Wallet,
proposal05Wallet,
proposal07Wallet,
proposal08Wallet,
proposal09Wallet,
} from "@constants/staticWallets";

interface CreateUserProps {
page: Page;
Expand Down Expand Up @@ -80,3 +86,28 @@ export async function createAuthWithMultipleStake({

await context.storageState({ path: auth });
}

export const getDraftProposalWalletAndState = (proposalType: string) => {
switch (proposalType) {
case ProposalType.info:
return {
storageState: ".auth/proposal05.json",
wallet: proposal05Wallet,
};
case ProposalType.treasury:
return {
storageState: ".auth/proposal07.json",
wallet: proposal07Wallet,
};
case ProposalType.updatesToTheConstitution:
return {
storageState: ".auth/proposal08.json",
wallet: proposal08Wallet,
};
case ProposalType.motionOfNoConfedence:
return {
storageState: ".auth/proposal09.json",
wallet: proposal09Wallet,
};
}
};
17 changes: 0 additions & 17 deletions tests/govtool-frontend/playwright/lib/helpers/exceptionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,3 @@ export async function expectWithInfo(
throw new Error(errorMessage);
}
}

export async function failureWithConsoleMessages(page: Page, fn: Function) {
const consoleMessages: string[] = [];
page.on("console", (msg) => {
if (msg.type() === "error") {
consoleMessages.push(msg.text());
}
});
try {
await fn();
} catch (error) {
Logger.fail(
`Failed: ${error.message}\nConsole messages: ${consoleMessages.join("\n")}`
);
throw error;
}
}
19 changes: 17 additions & 2 deletions tests/govtool-frontend/playwright/lib/helpers/page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CardanoTestWallet } from "@cardanoapi/cardano-test-wallet/types";
import { importWallet } from "@fixtures/importWallet";
import loadDemosExtension from "@fixtures/loadExtension";
import { Browser, Page } from "@playwright/test";
import { Browser, ConsoleMessage, Page } from "@playwright/test";
import { StaticWallet } from "@types";
import { Logger } from "./logger";

interface NewPageConfig {
storageState?: string;
Expand All @@ -29,5 +29,20 @@ export async function createNewPageWithWallet(
);
await importWallet(newPage, wallet);

injectLogger(newPage);

return newPage;
}

export function injectLogger(page: Page) {
// @ts-ignore
if (!page.isLoggerInjected) {
page.on("console", (msg: ConsoleMessage) => {
if (msg.type() === "error") {
Logger.fail(msg.text());
}
});
// @ts-ignore
page.isLoggerInjected = true;
}
}
Loading