Exercise¶
Before starting the exercises, pull the latest tests from the parent repository
$ git pull parent master
$ npm install
$ cd week12
$ npm install
Tasks¶
The week12
directory contains a skeleton Mithril application that you need to extend for this week’s exercise. The functionality you will be implementing is creating, displaying, updating, and deleting rooms. The room as implemented by the API has the following properties
- name: The name of the room
- address: The address of the building the room is in
- capacity: The number of seats in the room
- features: A comma-separated string identifying features (projector, white-board, blackboard, visualiser, …) that the room has
Task 1¶
Create the necessary code in the Mithril application to
- create a new room and save it to the server API
- edit the code in
task01.spec.js
to write an integration test that tests your Mithril code
Note
The assessment software will automatically clean the database before running the test, but cannot guarantee a specific room id for the newly created room.
Task 2¶
Create the necessary code in the Mithril application to
- display a list of all rooms
- edit the code in
task02.spec.js
to write an integration test that tests your Mithril code
Note
The assessment software will automatically clean the database before running the test. That means that your test needs to create the necessary rooms to test the list of rooms functionality.
Task 3¶
Create the necessary code in the Mithril application to
- display a single room
- edit the code in
task03.spec.js
to write an integration test that tests your Mithril code
Note
The assessment software will automatically clean the database before running the test. That means that your test needs to create the room to test the display of the single room.
Task 4¶
Create the necessary code in the Mithril application to
- update a single room
- edit the code in
task04.spec.js
to write an integration test that tests your Mithril code
Note
The assessment software will create a single room with the name “Test Room”, which your integration test must update.
Task 5¶
Create the necessary code in the Mithril application to
- delete a single room
- edit the code in
task05.spec.js
to write an integration test that tests your Mithril code
Note
The assessment software will create a single room with the name “Pointless Room”, which your integration test must update.
Submitting¶
To submit follow these steps:
Push all your changes into your repository by running
$ git add week12 $ git commit -m "PUT YOUR OWN MESSAGE HERE" $ git push
Create a new text file called
repository.txt
and into that add the clone URL of your repository.Submit this file via the student submission platform (“Mithril I”).