feat: unit tests for utils (#92)
* init * get unit test working for course.ts file * added some other tests * tests halfway + change config to accomodate js files * utility functions tests done * fix: config file + miscellaneous fixes * fix: prepare script * fix lock file --------- Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
co-authored by
Rotimi Best
parent
4b2e58b1de
commit
6d689ede45
@@ -0,0 +1,26 @@
|
||||
import showAppsSideBar from './showAppsSideBar';
|
||||
describe('ShowAppSideBar', () => {
|
||||
test("should return true when path includes '/lessons/' and does not include 'landingpage'", () => {
|
||||
const path = '/lessons/example';
|
||||
const result = showAppsSideBar(path);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
|
||||
test("should return false when path does not include '/lessons/'", () => {
|
||||
const path = '/home';
|
||||
const result = showAppsSideBar(path);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
test("should return false when path includes 'landingpage'", () => {
|
||||
const path = '/lessons/landingpage';
|
||||
const result = showAppsSideBar(path);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
test('should return false when path is empty', () => {
|
||||
const path = '';
|
||||
const result = showAppsSideBar(path);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user