Skip to content

Commit

Permalink
Add a test case in for course view visiblity icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Normanwqn committed Apr 18, 2024
1 parent d46580d commit f1dedab
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_components/test_course_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,21 @@ describe('CourseView tests', () => {
expect(wrapper.findAll('.project').length).toEqual(0);
expect(wrapper.find('#no-projects-message').exists()).toBe(true);
});

test('correct visibility icon is shown for each project', async () => {
project1.visible_to_students = true;
project2.visible_to_students = false;

wrapper = mount(CourseView, {
stubs: ['router-link', 'router-view'],
mocks: {
$route
}
});
expect(await wait_for_load(wrapper)).toBe(true);

expect(wrapper.findAll('.project').length).toEqual(2);
expect(wrapper.findAll('.fa-eye').length).toEqual(1);
expect(wrapper.findAll('.fa-eye-slash').length).toEqual(1);
});
});

0 comments on commit f1dedab

Please sign in to comment.