new test + adjustment

This commit is contained in:
Luis Rodriguez 2023-04-13 10:10:53 -05:00
parent dfab9f631e
commit 0fbd3d3b0c
2 changed files with 21 additions and 5 deletions

View File

@ -191,6 +191,25 @@ describe('ADMIN | CM | LV | Configure the view', () => {
screen.getByText("This value overrides the label displayed in the table's head")
).toBeInTheDocument();
});
it('should close edit modal onSubmit', async () => {
const history = createMemoryHistory();
const { queryByText } = render(makeApp(history));
await waitFor(() =>
expect(screen.getByText('Configure the view - Michka')).toBeInTheDocument()
);
fireEvent.click(screen.getByLabelText('Edit address'));
expect(
screen.getByText("This value overrides the label displayed in the table's head")
).toBeInTheDocument();
fireEvent.click(screen.getByText('Finish'));
expect(queryByText("This value overrides the label displayed in the table's head")).not.toBeInTheDocument();
});
it('should not show sortable toggle input if field not sortable', async () => {
const history = createMemoryHistory();

View File

@ -212,11 +212,8 @@ describe('CONTENT MANAGER | CONTAINERS | ListSettingsView | reducer', () => {
};
const expected = {
...state,
fieldToEdit: 'cover',
fieldForm: {
label: 'New Cover',
sortable: true,
},
fieldToEdit: '',
fieldForm: {},
modifiedData: {
metadatas: {
cover: {