|
|
@ -1,30 +1,48 @@ |
|
|
|
import 'mocha' |
|
|
|
import 'mocha'; |
|
|
|
import request from 'supertest' |
|
|
|
import request from 'supertest'; |
|
|
|
import { createTable } from '../../factory/table' |
|
|
|
import { createTable } from '../../factory/table'; |
|
|
|
import init from '../../init/index' |
|
|
|
import init from '../../init/index'; |
|
|
|
import { createProject, createSharedBase } from '../../factory/project' |
|
|
|
import { createProject, createSharedBase } from '../../factory/project'; |
|
|
|
import { beforeEach } from 'mocha' |
|
|
|
import { beforeEach } from 'mocha'; |
|
|
|
import { Exception } from 'handlebars' |
|
|
|
import { Exception } from 'handlebars'; |
|
|
|
import Project from '../../../../src/lib/models/Project' |
|
|
|
import Project from '../../../../src/lib/models/Project'; |
|
|
|
import { expect } from 'chai' |
|
|
|
import { expect } from 'chai'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Test case list
|
|
|
|
|
|
|
|
// 1. Get project info
|
|
|
|
|
|
|
|
// 2. UI ACL
|
|
|
|
|
|
|
|
// 3. Create project
|
|
|
|
|
|
|
|
// 4. Create project with existing title
|
|
|
|
|
|
|
|
// 5. Update project
|
|
|
|
|
|
|
|
// 6. Update project with existing title
|
|
|
|
|
|
|
|
// 7. Create project shared base
|
|
|
|
|
|
|
|
// 8. Created project shared base should have only editor or viewer role
|
|
|
|
|
|
|
|
// 9. Updated project shared base should have only editor or viewer role
|
|
|
|
|
|
|
|
// 10. Updated project shared base
|
|
|
|
|
|
|
|
// 11. Get project shared base
|
|
|
|
|
|
|
|
// 12. Delete project shared base
|
|
|
|
|
|
|
|
// 13. Meta diff sync
|
|
|
|
|
|
|
|
// 14. Meta diff sync
|
|
|
|
|
|
|
|
// 15. Meta diff sync
|
|
|
|
|
|
|
|
// 16. Get all projects meta
|
|
|
|
|
|
|
|
|
|
|
|
function projectTest() { |
|
|
|
function projectTest() { |
|
|
|
let context |
|
|
|
let context; |
|
|
|
let project |
|
|
|
let project; |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(async function() { |
|
|
|
beforeEach(async function () { |
|
|
|
context = await init() |
|
|
|
context = await init(); |
|
|
|
|
|
|
|
|
|
|
|
project = await createProject(context) |
|
|
|
project = await createProject(context); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Get project info', async () => { |
|
|
|
it('Get project info', async () => { |
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/info`) |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/info`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send({}) |
|
|
|
.send({}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// todo: Test by creating models under project and check if the UCL is working
|
|
|
|
// todo: Test by creating models under project and check if the UCL is working
|
|
|
|
it('UI ACL', async () => { |
|
|
|
it('UI ACL', async () => { |
|
|
@ -32,8 +50,8 @@ function projectTest() { |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/visibility-rules`) |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/visibility-rules`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send({}) |
|
|
|
.send({}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
}) |
|
|
|
}); |
|
|
|
// todo: Test creating visibility set
|
|
|
|
// todo: Test creating visibility set
|
|
|
|
|
|
|
|
|
|
|
|
it('List projects', async () => { |
|
|
|
it('List projects', async () => { |
|
|
@ -41,11 +59,12 @@ function projectTest() { |
|
|
|
.get('/api/v1/db/meta/projects/') |
|
|
|
.get('/api/v1/db/meta/projects/') |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send({}) |
|
|
|
.send({}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
if (response.body.list.length !== 1) new Error('Should list only 1 project') |
|
|
|
if (response.body.list.length !== 1) |
|
|
|
if (!response.body.pageInfo) new Error('Should have pagination info') |
|
|
|
new Error('Should list only 1 project'); |
|
|
|
}) |
|
|
|
if (!response.body.pageInfo) new Error('Should have pagination info'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Create project', async () => { |
|
|
|
it('Create project', async () => { |
|
|
|
const response = await request(context.app) |
|
|
|
const response = await request(context.app) |
|
|
@ -54,11 +73,11 @@ function projectTest() { |
|
|
|
.send({ |
|
|
|
.send({ |
|
|
|
title: 'Title1', |
|
|
|
title: 'Title1', |
|
|
|
}) |
|
|
|
}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
const newProject = await Project.getByTitleOrId(response.body.id) |
|
|
|
const newProject = await Project.getByTitleOrId(response.body.id); |
|
|
|
if (!newProject) return new Error('Project not created') |
|
|
|
if (!newProject) return new Error('Project not created'); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Create projects with existing title', async () => { |
|
|
|
it('Create projects with existing title', async () => { |
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
@ -67,8 +86,8 @@ function projectTest() { |
|
|
|
.send({ |
|
|
|
.send({ |
|
|
|
title: project.title, |
|
|
|
title: project.title, |
|
|
|
}) |
|
|
|
}) |
|
|
|
.expect(400) |
|
|
|
.expect(400); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// todo: fix passport user role popluation bug
|
|
|
|
// todo: fix passport user role popluation bug
|
|
|
|
// it('Delete project', async async () => {
|
|
|
|
// it('Delete project', async async () => {
|
|
|
@ -99,10 +118,11 @@ function projectTest() { |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}`) |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send() |
|
|
|
.send() |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
if (response.body.id !== project.id) return new Error('Got the wrong project') |
|
|
|
if (response.body.id !== project.id) |
|
|
|
}) |
|
|
|
return new Error('Got the wrong project'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Update projects', async () => { |
|
|
|
it('Update projects', async () => { |
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
@ -111,18 +131,18 @@ function projectTest() { |
|
|
|
.send({ |
|
|
|
.send({ |
|
|
|
title: 'NewTitle', |
|
|
|
title: 'NewTitle', |
|
|
|
}) |
|
|
|
}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
const newProject = await Project.getByTitleOrId(project.id) |
|
|
|
const newProject = await Project.getByTitleOrId(project.id); |
|
|
|
if (newProject.title !== 'NewTitle') { |
|
|
|
if (newProject.title !== 'NewTitle') { |
|
|
|
return new Error('Project not updated') |
|
|
|
return new Error('Project not updated'); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Update projects with existing title', async function() { |
|
|
|
it('Update projects with existing title', async function () { |
|
|
|
const newProject = await createProject(context, { |
|
|
|
const newProject = await createProject(context, { |
|
|
|
title: 'NewTitle1', |
|
|
|
title: 'NewTitle1', |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.patch(`/api/v1/db/meta/projects/${project.id}`) |
|
|
|
.patch(`/api/v1/db/meta/projects/${project.id}`) |
|
|
@ -130,8 +150,8 @@ function projectTest() { |
|
|
|
.send({ |
|
|
|
.send({ |
|
|
|
title: newProject.title, |
|
|
|
title: newProject.title, |
|
|
|
}) |
|
|
|
}) |
|
|
|
.expect(400) |
|
|
|
.expect(400); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Create project shared base', async () => { |
|
|
|
it('Create project shared base', async () => { |
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
@ -141,18 +161,18 @@ function projectTest() { |
|
|
|
roles: 'viewer', |
|
|
|
roles: 'viewer', |
|
|
|
password: 'test', |
|
|
|
password: 'test', |
|
|
|
}) |
|
|
|
}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id) |
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id); |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
if ( |
|
|
|
!updatedProject.uuid || |
|
|
|
!updatedProject.uuid || |
|
|
|
updatedProject.roles !== 'viewer' || |
|
|
|
updatedProject.roles !== 'viewer' || |
|
|
|
updatedProject.password !== 'test' |
|
|
|
updatedProject.password !== 'test' |
|
|
|
) { |
|
|
|
) { |
|
|
|
return new Error('Shared base not configured properly') |
|
|
|
return new Error('Shared base not configured properly'); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Created project shared base should have only editor or viewer role', async () => { |
|
|
|
it('Created project shared base should have only editor or viewer role', async () => { |
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
@ -162,17 +182,17 @@ function projectTest() { |
|
|
|
roles: 'commenter', |
|
|
|
roles: 'commenter', |
|
|
|
password: 'test', |
|
|
|
password: 'test', |
|
|
|
}) |
|
|
|
}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id) |
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id); |
|
|
|
|
|
|
|
|
|
|
|
if (updatedProject.roles === 'commenter') { |
|
|
|
if (updatedProject.roles === 'commenter') { |
|
|
|
return new Error('Shared base not configured properly') |
|
|
|
return new Error('Shared base not configured properly'); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Updated project shared base should have only editor or viewer role', async () => { |
|
|
|
it('Updated project shared base should have only editor or viewer role', async () => { |
|
|
|
await createSharedBase(context.app, context.token, project) |
|
|
|
await createSharedBase(context.app, context.token, project); |
|
|
|
|
|
|
|
|
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.patch(`/api/v1/db/meta/projects/${project.id}/shared`) |
|
|
|
.patch(`/api/v1/db/meta/projects/${project.id}/shared`) |
|
|
@ -181,17 +201,17 @@ function projectTest() { |
|
|
|
roles: 'commenter', |
|
|
|
roles: 'commenter', |
|
|
|
password: 'test', |
|
|
|
password: 'test', |
|
|
|
}) |
|
|
|
}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id) |
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id); |
|
|
|
|
|
|
|
|
|
|
|
if (updatedProject.roles === 'commenter') { |
|
|
|
if (updatedProject.roles === 'commenter') { |
|
|
|
throw new Exception('Shared base not updated properly') |
|
|
|
throw new Exception('Shared base not updated properly'); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Updated project shared base', async () => { |
|
|
|
it('Updated project shared base', async () => { |
|
|
|
await createSharedBase(context.app, context.token, project) |
|
|
|
await createSharedBase(context.app, context.token, project); |
|
|
|
|
|
|
|
|
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.patch(`/api/v1/db/meta/projects/${project.id}/shared`) |
|
|
|
.patch(`/api/v1/db/meta/projects/${project.id}/shared`) |
|
|
@ -200,42 +220,42 @@ function projectTest() { |
|
|
|
roles: 'editor', |
|
|
|
roles: 'editor', |
|
|
|
password: 'test', |
|
|
|
password: 'test', |
|
|
|
}) |
|
|
|
}) |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id) |
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id); |
|
|
|
|
|
|
|
|
|
|
|
if (updatedProject.roles !== 'editor') { |
|
|
|
if (updatedProject.roles !== 'editor') { |
|
|
|
throw new Exception('Shared base not updated properly') |
|
|
|
throw new Exception('Shared base not updated properly'); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Get project shared base', async () => { |
|
|
|
it('Get project shared base', async () => { |
|
|
|
await createSharedBase(context.app, context.token, project) |
|
|
|
await createSharedBase(context.app, context.token, project); |
|
|
|
|
|
|
|
|
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/shared`) |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/shared`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send() |
|
|
|
.send() |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id) |
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id); |
|
|
|
if (!updatedProject.uuid) { |
|
|
|
if (!updatedProject.uuid) { |
|
|
|
throw new Exception('Shared base not created') |
|
|
|
throw new Exception('Shared base not created'); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Delete project shared base', async () => { |
|
|
|
it('Delete project shared base', async () => { |
|
|
|
await createSharedBase(context.app, context.token, project) |
|
|
|
await createSharedBase(context.app, context.token, project); |
|
|
|
|
|
|
|
|
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.delete(`/api/v1/db/meta/projects/${project.id}/shared`) |
|
|
|
.delete(`/api/v1/db/meta/projects/${project.id}/shared`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send() |
|
|
|
.send() |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id) |
|
|
|
const updatedProject = await Project.getByTitleOrId(project.id); |
|
|
|
if (updatedProject.uuid) { |
|
|
|
if (updatedProject.uuid) { |
|
|
|
throw new Exception('Shared base not deleted') |
|
|
|
throw new Exception('Shared base not deleted'); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// todo: Do compare api test
|
|
|
|
// todo: Do compare api test
|
|
|
|
|
|
|
|
|
|
|
@ -244,16 +264,16 @@ function projectTest() { |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/meta-diff`) |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/meta-diff`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send() |
|
|
|
.send() |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Meta diff sync', async () => { |
|
|
|
it('Meta diff sync', async () => { |
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.post(`/api/v1/db/meta/projects/${project.id}/meta-diff`) |
|
|
|
.post(`/api/v1/db/meta/projects/${project.id}/meta-diff`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send() |
|
|
|
.send() |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// todo: improve test. Check whether the all the actions are present in the response and correct as well
|
|
|
|
// todo: improve test. Check whether the all the actions are present in the response and correct as well
|
|
|
|
it('Meta diff sync', async () => { |
|
|
|
it('Meta diff sync', async () => { |
|
|
@ -261,33 +281,47 @@ function projectTest() { |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/audits`) |
|
|
|
.get(`/api/v1/db/meta/projects/${project.id}/audits`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send() |
|
|
|
.send() |
|
|
|
.expect(200) |
|
|
|
.expect(200); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('Get all projects meta', async () => { |
|
|
|
it('Get all projects meta', async () => { |
|
|
|
await createTable(context, project, { table_name: 'table1', title: 'table1' }) |
|
|
|
await createTable(context, project, { |
|
|
|
await createTable(context, project, { table_name: 'table2', title: 'table2' }) |
|
|
|
table_name: 'table1', |
|
|
|
await createTable(context, project, { table_name: 'table3', title: 'table3' }) |
|
|
|
title: 'table1', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
await createTable(context, project, { |
|
|
|
|
|
|
|
table_name: 'table2', |
|
|
|
|
|
|
|
title: 'table2', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
await createTable(context, project, { |
|
|
|
|
|
|
|
table_name: 'table3', |
|
|
|
|
|
|
|
title: 'table3', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.get(`/api/v1/aggregated-meta-info`) |
|
|
|
.get(`/api/v1/aggregated-meta-info`) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.send({}) |
|
|
|
.send({}) |
|
|
|
.expect(200) |
|
|
|
.expect(200) |
|
|
|
.then(res => { |
|
|
|
.then((res) => { |
|
|
|
expect(res.body).to.have.all.keys( |
|
|
|
expect(res.body).to.have.all.keys( |
|
|
|
'userCount', |
|
|
|
'userCount', |
|
|
|
'sharedBaseCount', |
|
|
|
'sharedBaseCount', |
|
|
|
'projectCount', |
|
|
|
'projectCount', |
|
|
|
'projects', |
|
|
|
'projects' |
|
|
|
) |
|
|
|
); |
|
|
|
expect(res.body).to.have.property('projectCount').to.eq(1) |
|
|
|
expect(res.body).to.have.property('projectCount').to.eq(1); |
|
|
|
expect(res.body).to.have.property('projects').to.be.an('array') |
|
|
|
expect(res.body).to.have.property('projects').to.be.an('array'); |
|
|
|
expect(res.body.projects[0].tableCount.table).to.be.eq(3) |
|
|
|
expect(res.body.projects[0].tableCount.table).to.be.eq(3); |
|
|
|
expect(res.body).to.have.nested.property('projects[0].tableCount.table').to.be.a('number') |
|
|
|
expect(res.body) |
|
|
|
expect(res.body).to.have.nested.property('projects[0].tableCount.view').to.be.a('number') |
|
|
|
.to.have.nested.property('projects[0].tableCount.table') |
|
|
|
expect(res.body).to.have.nested.property('projects[0].viewCount').to.be.an('object') |
|
|
|
.to.be.a('number'); |
|
|
|
|
|
|
|
expect(res.body) |
|
|
|
|
|
|
|
.to.have.nested.property('projects[0].tableCount.view') |
|
|
|
|
|
|
|
.to.be.a('number'); |
|
|
|
|
|
|
|
expect(res.body) |
|
|
|
|
|
|
|
.to.have.nested.property('projects[0].viewCount') |
|
|
|
|
|
|
|
.to.be.an('object') |
|
|
|
.have.keys( |
|
|
|
.have.keys( |
|
|
|
'formCount', |
|
|
|
'formCount', |
|
|
|
'gridCount', |
|
|
|
'gridCount', |
|
|
@ -299,7 +333,8 @@ function projectTest() { |
|
|
|
'sharedGalleryCount', |
|
|
|
'sharedGalleryCount', |
|
|
|
'sharedKanbanCount', |
|
|
|
'sharedKanbanCount', |
|
|
|
'sharedTotal', |
|
|
|
'sharedTotal', |
|
|
|
'sharedLockedCount') |
|
|
|
'sharedLockedCount' |
|
|
|
|
|
|
|
); |
|
|
|
expect(res.body.projects[0]).have.keys( |
|
|
|
expect(res.body.projects[0]).have.keys( |
|
|
|
'external', |
|
|
|
'external', |
|
|
|
'webhookCount', |
|
|
|
'webhookCount', |
|
|
@ -308,14 +343,18 @@ function projectTest() { |
|
|
|
'userCount', |
|
|
|
'userCount', |
|
|
|
'rowCount', |
|
|
|
'rowCount', |
|
|
|
'tableCount', |
|
|
|
'tableCount', |
|
|
|
'viewCount', |
|
|
|
'viewCount' |
|
|
|
) |
|
|
|
); |
|
|
|
expect(res.body).to.have.nested.property('projects[0].rowCount').to.be.an('array') |
|
|
|
expect(res.body) |
|
|
|
expect(res.body).to.have.nested.property('projects[0].external').to.be.an('boolean') |
|
|
|
.to.have.nested.property('projects[0].rowCount') |
|
|
|
}) |
|
|
|
.to.be.an('array'); |
|
|
|
}) |
|
|
|
expect(res.body) |
|
|
|
|
|
|
|
.to.have.nested.property('projects[0].external') |
|
|
|
|
|
|
|
.to.be.an('boolean'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default function() { |
|
|
|
export default function () { |
|
|
|
describe('Project', projectTest) |
|
|
|
describe('Project', projectTest); |
|
|
|
} |
|
|
|
} |
|
|
|