Skip to content

Commit ca73899

Browse files
committed
test: add additional test for no referral
1 parent f792e9a commit ca73899

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/zora/src/Zora.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { describe, expect, test, vi, beforeEach, MockedFunction } from 'vitest'
3030
import { PremintResponse } from './types'
3131
import axios from 'axios'
3232
import { validatePremint } from './validate'
33+
import { ZORA_DEPLOYER_ADDRESS } from './contract-addresses'
3334

3435
const MockedPremintResponse: PremintResponse = [
3536
{
@@ -516,7 +517,7 @@ describe('getDynamicNameParams function', () => {
516517
})
517518

518519
describe('getExternalUrl function', () => {
519-
test('should return correct url for 1155 mint with token id', async () => {
520+
test('should return correct url for 1155 mint with token id w/referral', async () => {
520521
const params = {
521522
chainId: Chains.ZORA,
522523
contractAddress: getAddress('0x393c46fe7887697124a73f6028f39751aa1961a3'),
@@ -529,6 +530,18 @@ describe('getExternalUrl function', () => {
529530
)
530531
})
531532

533+
test('should return correct url for 1155 mint with token id w/o referral', async () => {
534+
const params = {
535+
chainId: Chains.ZORA,
536+
contractAddress: getAddress('0x393c46fe7887697124a73f6028f39751aa1961a3'),
537+
tokenId: 1,
538+
}
539+
const result = await getExternalUrl(params)
540+
expect(result).toBe(
541+
`https://zora.co/collect/zora:0x393c46fe7887697124A73f6028f39751aA1961a3/1?referrer=${ZORA_DEPLOYER_ADDRESS}`,
542+
)
543+
})
544+
532545
test('should return correct url for 1155 mint without token id', async () => {
533546
const params = {
534547
chainId: Chains.ZORA,

0 commit comments

Comments
 (0)