Add tests for diagram