Skip to content

Commit

Permalink
merge temp branch into collections
Browse files Browse the repository at this point in the history
  • Loading branch information
costascaio committed Sep 17, 2020
1 parent 85583d0 commit 28a703d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/fixtures/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"slang": "cervix",
"name": "Cervix",
"Description": "This Image represent the cytopathologist of the uterine cervix using conventional smear (Pap smear). The Epithelial cell abonormalities (lesion) are adressed in six classes according to Bethesda System.",
"public": true,
"public": false,
"delete": false,
"owner": 1
}
Expand Down
9 changes: 8 additions & 1 deletion src/repositorios/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ const db = require("../database");
module.exports = {

async create_collection(collection){
return CollectionModel.create(collection);
return CollectionModel.create({
slang: collection.slang,
name: collection.name,
description: collection.description,
public: false,
delete: false,
owner: collection.owner
});
},

async make_collection_public(id_collection){
Expand Down
7 changes: 2 additions & 5 deletions src/repositorios/collection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

jest.useFakeTimers();

const { describe } = require("../models/CollectionModel");
let CollectionDOA = require("./collection");


Expand All @@ -17,7 +16,6 @@ describe(
slang: "jest",
public: false,
description: "test with jest",
delete: false,
owner: 1,
delete: false
})
Expand All @@ -31,7 +29,6 @@ describe(
slang: "jest",
public: false,
description: "test with jest",
delete: false,
owner: 1,
delete: false
}
Expand Down Expand Up @@ -213,7 +210,7 @@ describe(
test(
"make_collection_public",
() => {
return CollectionDOA.delete_collection(1)
return CollectionDOA.make_collection_public(1)
.then(
data => {
expect(data.dataValues)
Expand All @@ -236,7 +233,7 @@ describe(
test(
"make_collection_private",
() => {
return CollectionDOA.delete_collection(1)
return CollectionDOA.make_collection_private(1)
.then(
data => {
expect(data.dataValues)
Expand Down

0 comments on commit 28a703d

Please sign in to comment.