Skip to content

Commit 818831a

Browse files
test: addressed comments
1 parent d98da1a commit 818831a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/containers/Dashboard/DashboardLayout.test.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ describe('DashboardLayout', () => {
5252
expect(sidebarCol.children[0]).toHaveAttribute('id', 'org.openedx.frontend.learner_dashboard.widget_sidebar.v1');
5353
});
5454
};
55-
const testSidebarLayout = ({ isCollapsed = true }) => {
55+
const testSidebarLayout = ({ isCollapsed }) => {
5656
it('displays withSidebar width for course list column', () => {
5757
const courseListCol = screen.getByText('test children').parentElement;
5858
expect(courseListCol).toHaveClass('col-xl-8');
5959
const sidebarCol = courseListCol.nextSibling;
6060
expect(sidebarCol).toHaveClass('sidebar-column', !isCollapsed && 'not-collapsed');
6161
});
6262
};
63-
const testNoSidebarLayout = ({ isCollapsed = true }) => {
63+
const testNoSidebarLayout = ({ isCollapsed }) => {
6464
it('displays noSidebar width for course list column', () => {
6565
const courseListCol = screen.getByText('test children').parentElement;
6666
expect(courseListCol).toHaveClass('col-xl-12');
@@ -74,14 +74,14 @@ describe('DashboardLayout', () => {
7474
hooks.useDashboardLayoutData.mockReturnValueOnce({ ...hookProps, sidebarShowing: true });
7575
});
7676
testColumns();
77-
testSidebarLayout({});
77+
testSidebarLayout({ isCollapsed: true });
7878
});
7979
describe('sidebar not showing', () => {
8080
beforeEach(() => {
8181
hooks.useDashboardLayoutData.mockReturnValueOnce({ ...hookProps });
8282
});
8383
testColumns();
84-
testNoSidebarLayout({});
84+
testNoSidebarLayout({ isCollapsed: true });
8585
});
8686
});
8787

src/containers/Dashboard/index.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jest.mock('./DashboardLayout', () => jest.fn(() => <div>DashboardLayout</div>));
2727
const pageTitle = 'test-page-title';
2828

2929
describe('Dashboard', () => {
30-
const createWrapper = (props) => {
30+
const createWrapper = (props = {}) => {
3131
const {
3232
hasCourses = true,
3333
initIsPending = true,
@@ -42,7 +42,7 @@ describe('Dashboard', () => {
4242

4343
describe('render', () => {
4444
it('page title is displayed in sr-only h1 tag', () => {
45-
createWrapper({});
45+
createWrapper();
4646
const heading = screen.getByText(pageTitle);
4747
expect(heading).toHaveClass('sr-only');
4848
});

0 commit comments

Comments
 (0)