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


TypeScript helper.assert类代码示例

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


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

示例1: it

  it('has the appropriate label style', function() {
    assert.equal(label.style.fontSize, '16px', 'has the appropriate font size');
    assert.equal(label.style.fontWeight, 'bold', 'has the appropriate font weight');

    var dateInput = dateField.firstChild;
    assert.equal(dateInput.style.width, '6.5em', 'has the appropriate width for the date input');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:Activity2Test.ts

示例2: 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

示例3: 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

示例4: it

  it('has the appropriate style', function() {
    var style = domElement.style;

    assert.equal(style.display, 'inline-block',
      'has display of inline-block to have the option list postioned appropriately');
    assert.equal(style['-webkit-user-select'], 'none', 'has the text unselectable');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:DropdownButtonTest.ts

示例5: 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

示例6: 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

示例7: it

    it('throws meaningful error messages', function() {
      assert.throws(function callWithABadTagNameArgument() {
        var badTagName = 42;
        domElement = createDOMElement(badTagName);
      },
        'createDOMElement expects the first argument, tagName, to be a DOM element'
      );

      assert.throws(function callWithABadStyleArgument() {
        var badStyle = 42;

        domElement = createDOMElement('thing', badStyle);
      },
        'createDOMElement expects the second argument, style, to be a hash'
      );

      assert.throws(function callWithABadAttributesArgument() {
        var goodStyle = {};
        var badAttributes = 42;

        domElement = createDOMElement('thing', goodStyle, badAttributes);
      },
        'createDOMElement expects the third argument, attributes, to be a hash'
      );
    });
开发者ID:gurdiga,项目名称:xo,代码行数:25,代码来源:createDOMElementTest.ts

示例8: it

  it('can be setValue()', function() {
    labeledCheckbox.setValue(true);
    assert.equal(checkbox.checked, true, 'can be checked');

    labeledCheckbox.setValue(false);
    assert.equal(checkbox.checked, false, 'can be unchecked');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:LabeledCheckboxTest.ts


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