Fakultas Ilmu Komputer UI

Commit 4830af1d authored by Shafiya Adzhani's avatar Shafiya Adzhani
Browse files

[REFACTOR] fix employee dropdown test

parent 46543cbc
Pipeline #72114 failed with stages
in 4 minutes and 46 seconds
......@@ -2,12 +2,14 @@ import {fireEvent, screen, render} from '@testing-library/react'
import EmployeeDropdown from './EmployeeDropdown'
test('renders Employee Dropdown', () => {
render(<EmployeeDropdown />)
const setEmployeeData = jest.fn()
render(<EmployeeDropdown setEmployeeData={setEmployeeData} />)
expect(screen.getByTestId('selected-value')).toBeInTheDocument()
})
test('can open employee dropdown and show options', () => {
render(<EmployeeDropdown />)
const setEmployeeData = jest.fn()
render(<EmployeeDropdown setEmployeeData={setEmployeeData} />)
const openDropdown = screen.getByText(/Pilih salah satu/i)
fireEvent.click(openDropdown)
......@@ -16,7 +18,8 @@ test('can open employee dropdown and show options', () => {
})
test('can open employee dropdown and click options', () => {
render(<EmployeeDropdown />)
const setEmployeeData = jest.fn()
render(<EmployeeDropdown setEmployeeData={setEmployeeData} />)
const openDropdown = screen.getByText(/Pilih salah satu/i)
fireEvent.click(openDropdown)
......
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