Fakultas Ilmu Komputer UI

Commit fd81c5f7 authored by Nurul Srianda Putri's avatar Nurul Srianda Putri
Browse files

[REFACTOR] refactor test for formiumk2

parent 1526ca13
Pipeline #72109 canceled with stages
import {screen, render} from '@testing-library/react'
import FormIUMK2 from './FormIUMK2'
import {
screen,
fireEvent,
waitForElementToBeRemoved,
} from '@testing-library/react'
import FormIUMK from '../../pages/formiumk'
import {testRender, makeTestStore, fixtureSet} from '../../testUtils'
import userEvent from '@testing-library/user-event'
test('renders FormIUMK2 element', async() => {
const store = makeTestStore(fixtureSet)
testRender(<FormIUMK />, {store})
userEvent.type(screen.getByTestId('form-1-nama-field'), 'pt ABC')
userEvent.click(screen.getByTestId('form-1-status-pt'))
userEvent.type(
screen.getByTestId('form-1-alamat-field'),
'Jl. TB Simatupang No. 5 Ragunan, Pasar Minggu Jakarta 12550',
)
userEvent.type(
screen.getByTestId('form-1-barang-jasa-field'),
'Travel Agency',
)
let lanjutButton = screen.getByTestId('lanjut-button')
fireEvent.click(lanjutButton)
await waitForElementToBeRemoved(() => screen.getByTestId('form-1-nama-field'))
test('renders FormIUMK2 element', () => {
render(<FormIUMK2 />)
expect(screen.getByTestId('form-iumk-2')).toBeInTheDocument()
expect(screen.getByTestId('form-iumk-2-judul')).toBeInTheDocument()
expect(screen.getByTestId('form-iumk-2-deskripsi')).toBeInTheDocument()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment