It is time for testing. We decided that the test needs to be a unit test which can more generally surpress calendar operations, with sequence of message injections.
That way we can make sure calendar operations are taking place according to RFCs and reacts to predefined behaviour according to given responses. XPCshell based unit test will provide preloaded response data imitating various CalDav server behaviours.
Unit test will basically create a temporary HTTP server on localhost using httpd.js. Calendar will send sync requests to the server and server will respond to them with different response data. Calendar reactions will be asserted against expected values.
As we decided, the test needs to be modular enough to mimic behaviour of different CalDav servers and changing the response data easily. The most challenging thing would be bringing the modularity to the test.
The test will contain :
- Send initial PROPFIND request
- Send multistatus requestto get hrefs of events
- Send multiget request
- Inject calendar data
- Assert for schedule-tag and etag values