當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript assert.isTrue方法代碼示例

本文整理匯總了TypeScript中test/helper.assert.isTrue方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript assert.isTrue方法的具體用法?TypeScript assert.isTrue怎麽用?TypeScript assert.isTrue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在test/helper.assert的用法示例。


在下文中一共展示了assert.isTrue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

  it('can be inserted after a given DOM element', function() {
    var container = createDOMElement('container');
    var firstChild = createDOMElement('first-child');
    var secondChild = createDOMElement('second-child');
    container.appendChild(firstChild);
    container.appendChild(secondChild);

    personSection.insertAfter(firstChild);
    assert.isTrue(firstChild.nextSibling === domElement, 'is inserted after the given DOM element');
    assert.isTrue(secondChild.previousSibling === domElement,
      'is inserted before the given DOM element’s next sibling');
  });
開發者ID:gurdiga,項目名稱:xo,代碼行數:12,代碼來源:PersonSection2Test.ts

示例2: it

  it('adds the `toggle` method', function() {
    assert.isFunction(field.toggle);

    field.toggle();
    assert.isFalse(field.isShown(), 'hides widget’s DOM element when it’s visible');

    field.toggle();
    assert.isTrue(field.isShown(), 'shows widget’s DOM element when it’s hidden');
  });
開發者ID:gurdiga,項目名稱:xo,代碼行數:9,代碼來源:WidgetRoleTest.ts

示例3: it

  it('has the date picker button styled appropriately', function() {
    assert.isTrue(datePickerButton.hasAttribute('shy'), 'is’s shy');

    var css = datePickerButton.style;
    assert.equal(css.position, 'absolute', 'it’s absolutely positioned not to affect the layout');
    assert.equal(css.marginTop, '2px', 'vertically align the icon with the input text');
    assert.equal(css.marginLeft, '-18px', 'uses 18px of negative left margin to look as being inside of the field');
    assert.equal(css.width, '20px', 'is 20px wide to accommodate clicking');
    assert.equal(css.height, '20px', 'is 20px high to accommodate clicking');
    assert.equal(css.padding, '0px', 'has no padding');
    assert.equal(css.backgroundColor, 'transparent', 'is transparent to be less intrusive');
    assert.match(css.backgroundImage, /^url\(.+\)/, 'has a date picker image on the background');
    assert.equal(css.backgroundPosition, '50% 50%', 'its background image is centered');
    assert.equal(css.backgroundRepeat, 'no-repeat', 'background image is not repeated');
  });
開發者ID:gurdiga,項目名稱:xo,代碼行數:15,代碼來源:DateFieldInputTest.ts

示例4: it

 it('is styled appropriately', function() {
   var css = input.style;
   assert.equal(css.color, 'black', 'its text renders in black color');
   assert.equal(css.padding, '4px', 'has 4 px padding');
   assert.equal(css.fontWeight, 'bold', 'the text is rendered with bold');
   assert.equal(css.fontSize, '14px', 'the text is rendered with 14px');
   assert.equal(css.fontFamily, 'sans-serif', 'the text is rendered with sans-serif');
   assert.equal(css.width, '200px', 'is 200px wide');
   assert.equal(
     css.backgroundImage,
     'url("data:image/gif;base64,R0lGODlhMgAYAIABAN3d3f///yH5BAEKAAEALAAAAAAyABgAAAIrjI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyrAGBjd96zu9+D/wFCgA7")',
     'has the image of a fine dotted line on the background'
   );
   assert.equal(css.backgroundPosition, '0px -4px',
     'the background image is vertically positioned -4px to match the input padding');
   assert.equal(css.borderRadius, '2px', 'has nice rounded corners');
   assert.equal(css.borderWidth, '0px', 'it has no border, it’s role is taken on by the background image');
   assert.equal(css.outlineWidth, '0px', 'it has no outline, it’s role is taken on by the box-shadow');
   assert.isTrue(input.hasAttribute('has-on-focus-effect'), 'is outlined on focus');
 });
開發者ID:gurdiga,項目名稱:xo,代碼行數:20,代碼來源:LabeledTextFieldTest.ts


注:本文中的test/helper.assert.isTrue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。