Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   QUnit.test("test create image funtion suite", function(assert) {
  2.     var PATH_NAME = "/portaldest/destination/JAM/api/v1/OData/thumbnailUrl/path"
  3.     var myHeaderButton = document.createElement('button');
  4.     var jamProfileImage = document.createElement('img');
  5.     var stubGetElementById = sinon.stub(document, 'getElementById');
  6.  
  7.     stubGetElementById.withArgs('meAreaHeaderButton').returns(myHeaderButton);
  8.     stubGetElementById.withArgs('jamProfileImage').returns(jamProfileImage);
  9.     notificationControl.thumnailImageUrl = "thumbnailUrl/path";
  10.     notificationControl.createImageTag();
  11.  
  12.     //NOTE : IE does not support the URL API
  13.     let jamPathName = new URL(jamProfileImage.src).pathname;
  14.     assert.equal(jamPathName, PATH_NAME);
  15.  
  16.     stubGetElementById.restore();
  17.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement