Skip to content

Commit

Permalink
wip: toward a test for creating notes
Browse files Browse the repository at this point in the history
  • Loading branch information
NiloCK committed Aug 31, 2023
1 parent 5703466 commit 5f01504
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/express/test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,29 @@ test('Course Methods', async () => {
expect( courses3.find((c) => c.split(' - ')[0] === courseID) ).toBeUndefined();
});

test('createNote', async () => {
const crs = createTestCourse();
const createResp = await client.createCourse(crs, credentials);

const crsClient = client.getCourseClient(createResp.data!.courseID);
const cfg = await crsClient.getConfig();

for (const k in crs) {
expect(cfg[k]).toEqual(crs[k]);
}
// expect(cfg).toEqual(crs);
crsClient.addData({
author: 'test-author',
data: "this is a test",
tags: ['test-tag'],
courseID: crsClient.id,
codeCourse: 'test-code-course-id',
shape: {
fields: [],
name: DataShapeName.Blanks,
},
})
});
afterAll(async () => {
// see https://stackoverflow.com/questions/54562879/jest-open-handle-when-using-node-exec/75830272#75830272
serverProcess.stdin.destroy();
Expand Down

0 comments on commit 5f01504

Please sign in to comment.