tiny tweak

This commit is contained in:
Pig Fang 2020-07-04 18:32:16 +08:00
parent 2bfa018e96
commit c145803840
No known key found for this signature in database
GPG Key ID: A8198F548DADA9E2
2 changed files with 10 additions and 6 deletions

View File

@ -198,8 +198,12 @@ const SkinLibrary: React.FC = () => {
onChange={handleNameChange}
/>
<div className="input-group-append">
<button className="btn btn-primary px-3" type="submit">
{t('general.submit')}
<button
className="btn btn-primary px-3"
type="submit"
title={t('vendor.datatable.search')}
>
<i className="fas fa-search"></i>
</button>
</div>
</div>

View File

@ -46,13 +46,13 @@ test('without authenticated', async () => {
test('search by keyword', async () => {
fetch.get.mockResolvedValue(createPaginator([]))
const { getByText, getByPlaceholderText } = render(<SkinLibrary />)
const { getByTitle, getByPlaceholderText } = render(<SkinLibrary />)
await waitFor(() => expect(fetch.get).toBeCalled())
fireEvent.input(getByPlaceholderText(t('vendor.datatable.search')), {
target: { value: 'k' },
})
fireEvent.click(getByText(t('general.submit')))
fireEvent.click(getByTitle(t('vendor.datatable.search')))
await waitFor(() =>
expect(fetch.get).toHaveBeenLastCalledWith(
urls.skinlib.list(),
@ -88,7 +88,7 @@ test('reset query', async () => {
window.blessing.extra.currentUid = 1
fetch.get.mockResolvedValue(createPaginator([]))
const { getByText, getByPlaceholderText, queryByText } = render(
const { getByText, getByTitle, getByPlaceholderText, queryByText } = render(
<SkinLibrary />,
)
await waitFor(() => expect(fetch.get).toBeCalled())
@ -98,7 +98,7 @@ test('reset query', async () => {
fireEvent.input(getByPlaceholderText(t('vendor.datatable.search')), {
target: { value: 'k' },
})
fireEvent.click(getByText(t('general.submit')))
fireEvent.click(getByTitle(t('vendor.datatable.search')))
await waitFor(() => expect(fetch.get).toBeCalled())
fireEvent.click(getByText(t('skinlib.seeMyUpload')))
await waitFor(() => expect(fetch.get).toBeCalled())