Add tests for metadata constraints