当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript assert.equal方法代码示例

本文整理汇总了TypeScript中test/helper.assert.equal方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.equal方法的具体用法?TypeScript assert.equal怎么用?TypeScript assert.equal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在test/helper.assert的用法示例。


在下文中一共展示了assert.equal方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

  it('is accessible', function() {
    assert.equal(domElement.getAttribute('role'), 'region', 'has the appropriate ARIA role');

    var sectionTitle = domElement.childNodes[0];
    assert.equal(domElement.getAttribute('aria-labelledby'), sectionTitle.id,
      'has the appropriate aria-labelledby');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:PersonSection2Test.ts

示例2: it

  it('has the “Cerere de intentare” section', function() {
    var sentenceSection = domElement.querySelector('inquiry-section');
    var css = sentenceSection.style;

    assert.equal(css.width, '380px', 'has the appropriate width');
    assert.equal(css.display, 'inline-block', 'goes next to the other section');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:NewCaseDialogTest.ts

示例3: it

  it('makes the element react to DOM event', function() {
    domElement.dispatchEvent(new Event('mouseenter'));
    assert.equal(domElement.style.opacity, '1', 'sets the element’s opacity to 1 on hover');

    domElement.dispatchEvent(new Event('mouseleave'));
    assert.equal(domElement.style.opacity, '0.3', 'sets the element’s opacity back to initial on mouse leave');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:makeShyTest.ts

示例4: it

 it('has the appropriate DOM structure', function() {
   assert.equal(domElement.tagName, 'SECTION', 'uses a semantic HTML5 tag name');
   assert.equal(domElement.getAttribute('widget-name'), widgetName, 'has the appropriate widget name');
   assert.equal(container.getAttribute('widget-name'), 'LabeledContainer', 'has a container');
   assert.equal(label.textContent, labelText, 'has the appropriate label text');
   assert.equal(dateField.tagName, 'DATE-FIELD', 'has a date field');
 });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:Activity2Test.ts

示例5: it

  it('has the appropriate default style', function() {
    assert.equal(domElement.style.border, 'none', 'has no border');
    assert.equal(domElement.style.font, 'inherit', 'inherits its font');
    assert.equal(domElement.style.padding, '0px', 'has no padding');

    assert.equal(label.style.font, 'inherit', 'label inherits its font');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:LabeledContainerTest.ts

示例6: it

    it('works', function() {
      document.body.appendChild(sandbox);

      var personTypeField = sandbox.querySelector('fieldset>labeled-select-field');
      assert.equal(getLabel(personTypeField), 'Gen persoană', 'has the appropriate label');
      assert.equal(getDOMValue(personTypeField), PersonSection.PERSON_TYPES.INDIVIDUAL, 'has the default value of “fizică”');

      var optionTexts = getOptionTexts(personTypeField.querySelector('select'));
      assert.equal(optionTexts.length, PersonSection.PERSON_TYPES.length, 'has the appropriate number of options');
      assert.deepEqual(optionTexts, PersonSection.PERSON_TYPES, 'has PERSON as the first option');

      setPersonType(PersonSection.PERSON_TYPES.COMPANY);
      var expectedFieldLabelTexts = ['Gen persoană', 'Denumire', 'IDNO', 'Sediu', 'Persoană de contact', 'Note'];
      assert.deepEqual(getLabelTexts(), expectedFieldLabelTexts, 'changes the fields appropriately');

      var nextFieldInput = getInputOfFieldBelowPersonTypeField(sandbox);
      assert.equal(document.activeElement, nextFieldInput, 'focuses the first field');

      document.body.removeChild(sandbox);

      function setPersonType(personType) {
        var select = personTypeField.querySelector('select');
        select.value = personType;
        select.dispatchEvent(new Event('change'));
      }
    });
开发者ID:gurdiga,项目名称:xo,代码行数:26,代码来源:PersonSectionTest.ts

示例7: it

 it('can be setChildWidgets()', function() {
   activityDetailsSection.setChildWidgets([
     document.createElement('another-widget')
   ]);
   assert.equal(domElement.children.length, 1, 'has the appropriate number of child elements');
   assert.equal(domElement.children[0].tagName, 'ANOTHER-WIDGET', 'the first child is rendered');
 });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:ActivityDetailsSectionTest.ts

示例8: it

  it('has the appropriate description', function() {
    var descriptionElement = domElement.children[0];

    assert.equal(descriptionElement.tagName, 'ACTIVITY-TITLE', 'has the appropriate tag name');
    assert.equal(descriptionElement.textContent, descriptionText, 'has the appropriate text');
    assert.equal(activity.getDescription(), descriptionText, 'exposes a gettr for the description text');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:ActivityTest.ts

示例9: it

 it('is styled appropriately', function() {
   var css = select.style;
   assert.equal(css.width, '200px', 'is 200px wide too (as LabeledTextField input is)');
   assert.equal(css.fontSize, '14px', 'has 14px font size');
   assert.equal(css.position, 'absolute', 'is absolutely-positioned to allow for precise vertical alignment without bothering the <label>');
   assert.equal(css.marginTop, '-2px', 'is shifted up 2px to vertically align with the <label>');
 });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:LabeledSelectFieldTest.ts


注:本文中的test/helper.assert.equal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。