added unit test for directive