diff --git a/backend/src/course/course.controller.spec.ts b/backend/src/course/course.controller.spec.ts index 3b3a456a..3f864633 100644 --- a/backend/src/course/course.controller.spec.ts +++ b/backend/src/course/course.controller.spec.ts @@ -40,7 +40,6 @@ describe('CourseController', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, { @@ -52,7 +51,6 @@ describe('CourseController', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, ]; @@ -65,7 +63,6 @@ describe('CourseController', () => { testUrls: courses[0].testUrls, imageUrl: courses[0].imageUrl, credit: courses[0].credit, - tags: courses[0].tags, description: courses[0].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -77,7 +74,6 @@ describe('CourseController', () => { testUrls: courses[1].testUrls, imageUrl: courses[1].imageUrl, credit: courses[1].credit, - tags: courses[1].tags, description: courses[1].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -99,7 +95,6 @@ describe('CourseController', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }; const mockResponse: Course = { @@ -130,7 +125,6 @@ describe('CourseController', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, { @@ -142,7 +136,6 @@ describe('CourseController', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1, 2], description: 'description', }, ]; @@ -154,7 +147,6 @@ describe('CourseController', () => { testUrls: courses[1].testUrls, imageUrl: courses[1].imageUrl, credit: courses[1].credit, - tags: courses[1].tags, description: courses[1].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -178,7 +170,6 @@ describe('CourseController', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, { @@ -190,7 +181,6 @@ describe('CourseController', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, ]; @@ -203,7 +193,6 @@ describe('CourseController', () => { testUrls: courses[0].testUrls, imageUrl: courses[0].imageUrl, credit: courses[0].credit, - tags: courses[0].tags, description: courses[0].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -215,7 +204,6 @@ describe('CourseController', () => { testUrls: courses[1].testUrls, imageUrl: courses[1].imageUrl, credit: courses[1].credit, - tags: courses[1].tags, description: courses[1].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -235,7 +223,6 @@ describe('CourseController', () => { imageUrl: 'image1', credit: 10, description: 'description', - tags: [1, 3], }; const responseCourse: Course = { id: '7e67a826-636f-4fa7-a7a8-f1d57573f95f', @@ -263,7 +250,6 @@ describe('CourseController', () => { imageUrl: 'image1', credit: 10, description: 'description', - tags: [2], name: '', }; const responseCourse: Course = { diff --git a/backend/src/course/course.service.spec.ts b/backend/src/course/course.service.spec.ts index d583630d..43d78827 100644 --- a/backend/src/course/course.service.spec.ts +++ b/backend/src/course/course.service.spec.ts @@ -60,7 +60,6 @@ describe('CourseService', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, { @@ -72,7 +71,6 @@ describe('CourseService', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1, 2], description: 'description', }, ]; @@ -85,7 +83,6 @@ describe('CourseService', () => { testUrls: courses[0].testUrls, imageUrl: courses[0].imageUrl, credit: courses[0].credit, - tags: courses[0].tags, description: courses[0].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -97,7 +94,6 @@ describe('CourseService', () => { testUrls: courses[1].testUrls, imageUrl: courses[1].imageUrl, credit: courses[1].credit, - tags: courses[1].tags, description: courses[1].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -122,7 +118,6 @@ describe('CourseService', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }; const mockResponse = { @@ -132,7 +127,6 @@ describe('CourseService', () => { testUrls: courses.testUrls, imageUrl: courses.imageUrl, credit: courses.credit, - tags: courses.tags, description: courses.description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -157,7 +151,6 @@ describe('CourseService', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, { @@ -169,7 +162,6 @@ describe('CourseService', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1, 2], description: 'description', }, ]; @@ -181,7 +173,6 @@ describe('CourseService', () => { testUrls: courses[1].testUrls, imageUrl: courses[1].imageUrl, credit: courses[1].credit, - tags: courses[1].tags, description: courses[1].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -222,7 +213,6 @@ describe('CourseService', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, { @@ -234,7 +224,6 @@ describe('CourseService', () => { imageUrl: 'https://in.images.search.yahoo.com/images/view;_ylt=Awr1SSiRTy1kb4cLLsq9HAx.;_ylu=c2VjA3NyBHNsawNpbWcEb2lkAzQyZTY0MDk5ZDU4ZTA0NjIxZGIyOTFiMzFhNjU3YmIxBGdwb3MDMjAEaXQDYmluZw--?back=https%3A%2F%2Fin.images.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Dclean%2Bcode%26type%3DE211IN826G0%26fr%3Dmcafee%26fr2%3Dpiv-web%26tab%3Dorganic%26ri%3D20&w=1280&h=720&imgurl=i.ytimg.com%2Fvi%2F4LUNr4AeLZM%2Fmaxresdefault.jpg&rurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4LUNr4AeLZM&size=138.8KB&p=clean+code&oid=42e64099d58e04621db291b31a657bb1&fr2=piv-web&fr=mcafee&tt=Clean+Code%21+-+YouTube&b=0&ni=21&no=20&ts=&tab=organic&sigr=BwBZBBbiDgZS&sigb=N4X2keUrYF9q&sigi=E7Tff6GG25xa&sigt=NZfjbeVtrurr&.crumb=AVdd1qPlDGC&fr=mcafee&fr2=piv-web&type=E211IN826G0', credit: 10, - tags: [1], description: 'description', }, ]; @@ -248,7 +237,6 @@ describe('CourseService', () => { testUrls: courses[0].testUrls, imageUrl: courses[0].imageUrl, credit: courses[0].credit, - tags: courses[0].tags, description: courses[0].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -260,7 +248,6 @@ describe('CourseService', () => { testUrls: courses[1].testUrls, imageUrl: courses[1].imageUrl, credit: courses[1].credit, - tags: courses[1].tags, description: courses[1].description, createdAt: Date.prototype, updatedAt: Date.prototype, @@ -300,8 +287,8 @@ describe('CourseService', () => { testUrls: ['testurl1'], imageUrl: 'image1', credit: 10, + tags: [1, 2], description: 'description', - tags: [1, 3], }; const responseCourse: Course = { id: '7e67a826-636f-4fa7-a7a8-f1d57573f95f', @@ -344,7 +331,6 @@ describe('CourseService', () => { imageUrl: 'image1', credit: 10, description: 'description', - tags: [1, 3], }; const responseCourse: Course = { id: '7e67a826-636f-4fa7-a7a8-f1d57573f95f', @@ -373,8 +359,8 @@ describe('CourseService', () => { testUrls: ['testurl2'], imageUrl: 'image1', credit: 10, + tags: [1, 2], description: 'description', - tags: [2], name: '', }; const responseCourse = { @@ -384,7 +370,6 @@ describe('CourseService', () => { testUrls: ['testurl2'], imageUrl: 'image1', credit: 10, - tags: [2], description: 'description', createdAt: Date.prototype, updatedAt: Date.prototype, @@ -416,7 +401,6 @@ describe('CourseService', () => { imageUrl: 'image1', credit: 10, description: 'description', - tags: [2], name: '', }; diff --git a/backend/src/course/dto/course.dto.ts b/backend/src/course/dto/course.dto.ts index f1d9123e..09068779 100644 --- a/backend/src/course/dto/course.dto.ts +++ b/backend/src/course/dto/course.dto.ts @@ -16,7 +16,7 @@ export class CourseDto { @IsNotEmpty() credit: number; - tags: number[]; + tags?: number[]; description: string; } diff --git a/backend/src/course/dto/updateCourse.dto.ts b/backend/src/course/dto/updateCourse.dto.ts index afae4912..abc746fa 100644 --- a/backend/src/course/dto/updateCourse.dto.ts +++ b/backend/src/course/dto/updateCourse.dto.ts @@ -4,6 +4,6 @@ export class updateCourseDto { testUrls: string[]; imageUrl: string; credit: number; - tags: number[]; + tags?: number[]; description: string; } diff --git a/backend/src/user/user.controller.spec.ts b/backend/src/user/user.controller.spec.ts index 53103b10..7a2e46bb 100644 --- a/backend/src/user/user.controller.spec.ts +++ b/backend/src/user/user.controller.spec.ts @@ -99,7 +99,6 @@ describe('UserController', () => { testUrls: [''], imageUrl: 'https://docs.nestjs.com/assets/logo-small.svg', credit: 10, - tags: [3], description: 'description', createdAt: Date.prototype, updatedAt: Date.prototype, @@ -125,7 +124,6 @@ describe('UserController', () => { testUrls: [''], imageUrl: 'https://docs.nestjs.com/assets/logo-small.svg', credit: 10, - tags: [3], description: 'description', createdAt: Date.prototype, updatedAt: Date.prototype, diff --git a/backend/src/user/user.service.spec.ts b/backend/src/user/user.service.spec.ts index 0d59451b..38bdc46b 100644 --- a/backend/src/user/user.service.spec.ts +++ b/backend/src/user/user.service.spec.ts @@ -106,7 +106,6 @@ describe('UserService', () => { testUrls: [''], imageUrl: 'https://docs.nestjs.com/assets/logo-small.svg', credit: 10, - tags: [3], description: 'description', createdAt: Date.prototype, updatedAt: Date.prototype, @@ -120,7 +119,6 @@ describe('UserService', () => { testUrls: [''], imageUrl: 'https://docs.nestjs.com/assets/logo-small.svg', credit: 10, - tags: [1, 2], description: 'description', createdAt: Date.prototype, updatedAt: Date.prototype, @@ -134,7 +132,6 @@ describe('UserService', () => { testUrls: [''], imageUrl: 'https://docs.nestjs.com/assets/logo-small.svg', credit: 10, - tags: [7, 6], description: 'description', createdAt: Date.prototype, updatedAt: Date.prototype, @@ -202,7 +199,6 @@ describe('UserService', () => { testUrls: [''], imageUrl: 'https://docs.nestjs.com/assets/logo-small.svg', credit: 10, - tags: [3], description: 'description', createdAt: Date.prototype, updatedAt: Date.prototype, @@ -216,7 +212,6 @@ describe('UserService', () => { testUrls: [''], imageUrl: 'https://docs.nestjs.com/assets/logo-small.svg', credit: 10, - tags: [1, 2], description: 'description', createdAt: Date.prototype, updatedAt: Date.prototype, @@ -553,7 +548,6 @@ describe('UserService', () => { it('should return 0 if the user is not enrolled for course', async () => { const mockCourse: Course = { id: 'course1', - name: 'name', resourseUrls: [], testUrls: [], @@ -582,7 +576,6 @@ describe('UserService', () => { it('should return 1 if the user is enrolled for course but not completed the course', async () => { const mockCourse: Course = { id: 'course1', - name: 'name', resourseUrls: [], testUrls: [], @@ -618,7 +611,6 @@ describe('UserService', () => { it('should return 2 if the user has completed the course', async () => { const mockCourse: Course = { id: 'course1', - name: 'name', resourseUrls: [], testUrls: [],