本文整理汇总了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');
});
示例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');
});
示例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');
});
示例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');
});