From 23674098b1bae25b614f430448f54fa3fd1dbed9 Mon Sep 17 00:00:00 2001 From: mmackz Date: Thu, 8 Aug 2024 08:46:07 -0700 Subject: [PATCH] test(Zora): add test for simulateMint function behavior --- packages/zora/src/Zora.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/zora/src/Zora.test.ts b/packages/zora/src/Zora.test.ts index 47926d228..4b4733896 100644 --- a/packages/zora/src/Zora.test.ts +++ b/packages/zora/src/Zora.test.ts @@ -15,6 +15,7 @@ import { import { EXPECTED_ENCODED_DATA_721, EXPECTED_ENCODED_DATA_1155, + MINT_V2_ZORA, } from './test-transactions' import { ActionType, @@ -31,6 +32,7 @@ import { describe, expect, test, vi, beforeEach, MockedFunction } from 'vitest' import { PremintResponse } from './types' import axios from 'axios' import { validatePremint } from './validate' +import { ZORA_TIMED_SALE_STRATEGY } from './contract-addresses' const MockedPremintResponse: PremintResponse = [ { @@ -573,3 +575,16 @@ describe('getExternalUrl function', () => { ) }) }) + +describe('simulateMint function', () => { + test('should simulate a 1155 mint when tokenId is not 0', async () => { + const mint = MINT_V2_ZORA.params as MintIntentParams + const value = parseEther('0.000111') + const account = '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF' + + const result = await simulateMint(mint, value, account) + const request = result.request + expect(request.address).toBe(ZORA_TIMED_SALE_STRATEGY) + expect(request.value).toBe(value) + }) +})