Skip to content

Commit

Permalink
test(Zora): add test for simulateMint function behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mmackz committed Aug 8, 2024
1 parent c163ded commit 2367409
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/zora/src/Zora.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import {
EXPECTED_ENCODED_DATA_721,
EXPECTED_ENCODED_DATA_1155,
MINT_V2_ZORA,
} from './test-transactions'
import {
ActionType,
Expand All @@ -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 = [
{
Expand Down Expand Up @@ -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)
})
})

0 comments on commit 2367409

Please sign in to comment.