Added unit test for media.js