Skip to content

Commit

Permalink
Merge branch 'main' into 2025-02-24-gui-defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
hardyjosh authored Feb 24, 2025
2 parents 0ed3fc1 + 6b194ac commit c0c6a19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ui-components/src/__tests__/DeploymentSteps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ describe('DeploymentSteps', () => {
const getAllFieldDefinitions = vi.fn();
const getAllDepositFields = vi.fn();
const getTokenInfo = vi.fn();
const areAllTokensSelected = vi.fn(() => true);

defaultProps.gui = {
getSelectTokens: () => mockSelectTokens,
Expand All @@ -718,7 +719,7 @@ describe('DeploymentSteps', () => {
getAllDepositFields,
isSelectTokenSet: () => false,
saveSelectToken: vi.fn(),
areAllTokensSelected: () => true,
areAllTokensSelected,
hasAnyDeposit: vi.fn(),
hasAnyVaultId: vi.fn(),
getCurrentDeployment: () => ({
Expand Down Expand Up @@ -752,6 +753,8 @@ describe('DeploymentSteps', () => {
const user = userEvent.setup();
render(DeploymentSteps, { props: defaultProps });

expect(areAllTokensSelected).toHaveBeenCalled();

await waitFor(() => {
expect(screen.getByText('Select Tokens')).toBeInTheDocument();
expect(screen.getByText('Token 1')).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import { getDeploymentTransactionArgs } from './getDeploymentTransactionArgs';
import type { HandleAddOrderResult } from './getDeploymentTransactionArgs';
import { DeploymentStepsError, DeploymentStepsErrorCode } from '$lib/errors';
import { onMount } from 'svelte';
interface Deployment {
key: string;
Expand Down Expand Up @@ -61,6 +62,10 @@
export let wagmiConnected: Writable<boolean>;
export let appKitModal: Writable<AppKit>;
onMount(async () => {
await areAllTokensSelected();
});
function getAllFieldDefinitions() {
try {
allFieldDefinitionsWithoutDefaults = gui.getAllFieldDefinitions(false);
Expand Down

0 comments on commit c0c6a19

Please sign in to comment.