1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00
market/tests/unit/components/PublishForm.test.tsx

31 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-05-07 08:03:30 +02:00
import React from 'react'
import { render } from '@testing-library/react'
import { transformPublishFormToMetadata } from '../../../src/utils/metadata'
2020-07-10 13:19:04 +02:00
import {
2020-07-16 13:39:02 +02:00
MetadataMarket,
MetadataPublishForm
2020-10-01 17:13:19 +02:00
} from '../../../src/@types/MetaData'
2020-10-20 14:51:20 +02:00
import PublishForm from '../../../src/components/pages/Publish/FormPublish'
2020-07-10 13:19:04 +02:00
import publishFormData from '../__fixtures__/testFormData'
import content from '../../../content/pages/publish.json'
2020-05-07 08:03:30 +02:00
describe('PublishForm', () => {
it('renders without crashing', async () => {
2020-10-02 14:48:30 +02:00
const { container } = render(<PublishForm content={content.form} />)
2020-05-07 08:03:30 +02:00
expect(container.firstChild).toBeInTheDocument()
})
2020-09-02 11:43:15 +02:00
// it('Form data is correctly transformed to asset Metadata', () => {
// const data: MetadataPublishForm = publishFormData
// let metadata: MetadataMarket = transformPublishFormToMetadata(data)
2020-05-07 08:03:30 +02:00
2020-09-02 11:43:15 +02:00
// expect(metadata.additionalInformation).toBeDefined()
// expect(metadata.main).toBeDefined()
2020-05-07 08:03:30 +02:00
2020-09-02 11:43:15 +02:00
// data.price = '1.3'
2020-05-07 08:03:30 +02:00
2020-09-02 11:43:15 +02:00
// metadata = transformPublishFormToMetadata(data)
// expect(metadata.main.price).toBe('1300000000000000000')
// })
2020-05-07 08:03:30 +02:00
})