updated table test cases

This commit is contained in:
Madhuri Sandbhor 2022-12-29 15:23:24 +01:00
parent b7a6b4e5ca
commit dc992ff208

View File

@ -20,8 +20,8 @@ const headers = [
metadatas: { label: 'Date', sortable: true }, metadatas: { label: 'Date', sortable: true },
}, },
{ {
key: 'user', key: 'fullname',
name: 'user', name: 'fullname',
metadatas: { label: 'User', sortable: true }, metadatas: { label: 'User', sortable: true },
}, },
]; ];
@ -29,21 +29,21 @@ const headers = [
const rows = [ const rows = [
{ {
id: 1, id: 1,
action: 'Update', action: 'role.update',
date: '2022-11-14T23:04:00.000Z', date: '2022-11-14T23:04:00.000Z',
user: 'John Doe', fullname: 'John Doe',
}, },
{ {
id: 2, id: 2,
action: 'Create', action: 'permission.create',
date: '2022-11-04T18:24:00.000Z', date: '2022-11-04T18:24:00.000Z',
user: 'Kai Doe', fullname: 'Kai Doe',
}, },
{ {
id: 3, id: 3,
action: '', action: '',
date: '2022-11-04T18:23:00.000Z', date: '2022-11-04T18:23:00.000Z',
user: 'Kai Doe', fullname: 'Kai Doe',
}, },
]; ];
@ -64,11 +64,11 @@ describe('ADMIN | Pages | AUDIT LOGS | ListView | Dynamic Table | Table Rows', (
it('should show the row data', () => { it('should show the row data', () => {
render(App); render(App);
expect(screen.getByText(/update action details/i)).toBeInTheDocument(); expect(screen.getByText(/update role/i)).toBeInTheDocument();
expect(screen.getByText(/november 14, 2022, 23:04:00/i)).toBeInTheDocument(); expect(screen.getByText(/november 14, 2022, 23:04:00/i)).toBeInTheDocument();
expect(screen.getByText(/john doe/i)).toBeInTheDocument(); expect(screen.getByText(/john doe/i)).toBeInTheDocument();
expect(screen.getByText(/create action details/i)).toBeInTheDocument(); expect(screen.getByText(/create permission/i)).toBeInTheDocument();
expect(screen.getByText(/november 4, 2022, 18:24:00/i)).toBeInTheDocument(); expect(screen.getByText(/november 4, 2022, 18:24:00/i)).toBeInTheDocument();
expect(screen.getAllByText(/kai doe/i).length).toBe(2); expect(screen.getAllByText(/kai doe/i).length).toBe(2);