Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
d4d8bea5
There was a problem fetching the pipeline summary.
Commit
d4d8bea5
authored
7 years ago
by
Fernando Erd
Browse files
Options
Downloads
Patches
Plain Diff
Add some tests
parent
da464a64
No related branches found
No related tags found
2 merge requests
!116
Release v1.0.0
,
!87
Add some tests
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/test/enrollment.js
+13
-0
13 additions, 0 deletions
src/test/enrollment.js
src/test/infrastructure.js
+122
-0
122 additions, 0 deletions
src/test/infrastructure.js
src/test/teacher.js
+13
-0
13 additions, 0 deletions
src/test/teacher.js
with
148 additions
and
0 deletions
src/test/enrollment.js
+
13
−
0
View file @
d4d8bea5
...
@@ -51,6 +51,19 @@ describe('request enrollments', () => {
...
@@ -51,6 +51,19 @@ describe('request enrollments', () => {
});
});
});
});
it
(
'
should list the years
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/enrollment/years
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
years
'
);
done
();
});
});
it
(
'
should list the locations
'
,
(
done
)
=>
{
it
(
'
should list the locations
'
,
(
done
)
=>
{
chai
.
request
(
server
)
chai
.
request
(
server
)
.
get
(
'
/api/v1/enrollment/location
'
)
.
get
(
'
/api/v1/enrollment/location
'
)
...
...
This diff is collapsed.
Click to expand it.
src/test/infrastructure.js
0 → 100644
+
122
−
0
View file @
d4d8bea5
process
.
env
.
NODE_ENV
=
'
test
'
;
const
chai
=
require
(
'
chai
'
);
const
dirtyChai
=
require
(
'
dirty-chai
'
);
chai
.
use
(
dirtyChai
);
const
chaiXml
=
require
(
'
chai-xml
'
);
chai
.
use
(
chaiXml
);
const
chaiHttp
=
require
(
'
chai-http
'
);
const
assert
=
chai
.
assert
;
const
expect
=
chai
.
expect
;
const
should
=
chai
.
should
();
// actually call the function
const
libs
=
`
${
process
.
cwd
()}
/libs`
;
const
server
=
require
(
`
${
libs
}
/app`
);
chai
.
use
(
chaiHttp
);
describe
(
'
request idhme
'
,
()
=>
{
it
(
'
should list default query infrastructure
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/infrastructure
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
school_place
'
);
done
();
});
});
it
(
'
should list the year range
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/infrastructure/years
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
years
'
);
done
();
});
});
it
(
'
should list the source
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/infrastructure/source
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
source
'
);
done
();
});
});
it
(
'
should list the locations detailed
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/infrastructure/location_detailed
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
done
();
});
});
it
(
'
should list the locations
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/infrastructure/location
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
done
();
});
});
it
(
'
should list the source
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/infrastructure/adm_dependency_detailed
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
done
();
});
});
it
(
'
should list the source
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/infrastructure/adm_dependency
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
done
();
});
});
});
This diff is collapsed.
Click to expand it.
src/test/teacher.js
+
13
−
0
View file @
d4d8bea5
...
@@ -65,6 +65,19 @@ describe('request teachers', () => {
...
@@ -65,6 +65,19 @@ describe('request teachers', () => {
});
});
});
});
it
(
'
should list the locations
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/teacher/years
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
years
'
);
done
();
});
});
it
(
'
should list the rural locations
'
,
(
done
)
=>
{
it
(
'
should list the rural locations
'
,
(
done
)
=>
{
chai
.
request
(
server
)
chai
.
request
(
server
)
.
get
(
'
/api/v1/teacher/rural_location
'
)
.
get
(
'
/api/v1/teacher/rural_location
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment