Add tests for completion and error