Skip to content

Commit

Permalink
Refactor generativeFrom function to use 'hash' as the previewParam in…
Browse files Browse the repository at this point in the history
…stead of 'koda'

Add FXHashMetadata import to content.test.ts
Add generativeUri and kind properties to Content type in content.test.ts
  • Loading branch information
vikiival committed Sep 16, 2024
1 parent 554aae7 commit 862890b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hyperdata/tests/content.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { describe, expect, it } from 'vitest'
import { OpenSeaMetadata, TezosMetadata, contentFrom, attributeFrom } from '../src'
import { OpenSeaMetadata, TezosMetadata, contentFrom, attributeFrom, FXHashMetadata } from '../src'
import fxhash from './examples/fxhash.json'
import koda from './examples/koda.json'
import poc from './examples/proof-of-chaos.json'

describe('contentFrom', () => {
it(`should parse FXhash metadata to Content correctly`, () => {
const metadata = fxhash as TezosMetadata
const metadata = fxhash as FXHashMetadata
expect(contentFrom(metadata)).toStrictEqual({
_raw: undefined,
name: metadata.name,
Expand All @@ -17,6 +17,8 @@ describe('contentFrom', () => {
banner: undefined,
externalUrl: metadata.externalUri,
generative: undefined,
generativeUri: metadata.generativeUri,
kind: undefined,
tags: [],
thumbnail: metadata.thumbnailUri,
type: '',
Expand Down Expand Up @@ -51,6 +53,8 @@ describe('contentFrom', () => {
banner: undefined,
externalUrl: metadata.external_url,
generative: undefined,
generativeUri: undefined,
kind: undefined,
tags: [],
thumbnail: undefined,
type: '',
Expand All @@ -69,6 +73,8 @@ describe('contentFrom', () => {
banner: undefined,
externalUrl: metadata.external_url,
generative: undefined,
generativeUri: undefined,
kind: undefined,
tags: [],
thumbnail: undefined,
type: 'video/mp4',
Expand Down

0 comments on commit 862890b

Please sign in to comment.