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

33 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'
2020-07-10 12:09:43 +02:00
import { transformPublishFormToMetadata } from '../../../src/components/pages/Publish/utils'
2020-07-10 13:19:04 +02:00
import {
2020-07-16 13:39:02 +02:00
MetadataMarket,
MetadataPublishForm
} from '../../../src/@types/Metadata'
2020-07-10 13:19:04 +02:00
import PublishForm from '../../../src/components/pages/Publish/PublishForm'
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-09-02 11:43:15 +02:00
const { container } = render(
<PublishForm content={content.form} isLoading={null} />
)
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
})