{"size": 1682, "ext": "js", "max_stars_repo_path": "src/TestSuites/CoreLevel1/tests/official/html/attribute/hc_attrinsertbefore1.js", "max_stars_repo_name": "javert-click/javert-click", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/TestSuites/CoreLevel1/tests/official/html/attribute/hc_attrinsertbefore1.js", "max_issues_repo_name": "javert-click/javert-click", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/TestSuites/CoreLevel1/tests/official/html/attribute/hc_attrinsertbefore1.js", "max_forks_repo_name": "javert-click/javert-click", "max_forks_repo_forks_event_min_datetime": "2021-02-22T11:20:29.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-22T11:20:29.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.1044776119, "max_line_length": 85, "alphanum_fraction": 0.6599286564}

var docs = initDOMHeapCoreLevel1();
var jsUnitCore = initJsUnitCore();
var DOMTestCase = initDOMTestCase(jsUnitCore);   


/**
* 
Appends a text node to an attribute and checks if the value of
the attribute is changed.

* @author Curt Arnold
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727
*/

     /*
     * @id hc_attrinsertbefore1
     */
     (function hc_attrinsertbefore1() {
   var success; 
    var doc;
      var acronymList;
      var testNode;
      var attributes;
      var titleAttr;
      var value;
      var textNode;
      var retval;
      var firstChild;
      var lastChild;
      var refChild = null;

      
	   
	   
	doc = docs["hc_staff.html"]
           acronymList = doc.getElementsByTagName("acronym");
      testNode = acronymList.item(3);
      attributes = testNode.attributes;

      titleAttr = attributes.getNamedItem("title");
      textNode = doc.createTextNode("terday");
      retval = titleAttr.insertBefore(textNode,refChild);
      value = titleAttr.value;

      jsUnitCore.assertEquals("attrValue","Yesterday",value);
       value = titleAttr.nodeValue;

      jsUnitCore.assertEquals("attrNodeValue","Yesterday",value);
       value = retval.nodeValue;

      jsUnitCore.assertEquals("retvalValue","terday",value);
       firstChild = titleAttr.firstChild;

      value = firstChild.nodeValue;

      jsUnitCore.assertEquals("firstChildValue","Yes",value);
       lastChild = titleAttr.lastChild;

      value = lastChild.nodeValue;

      jsUnitCore.assertEquals("lastChildValue","terday",value);
       
})()

