本文整理汇总了TypeScript中test/helper.getDOMValue函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getDOMValue函数的具体用法?TypeScript getDOMValue怎么用?TypeScript getDOMValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getDOMValue函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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'));
}
});
示例2: it
it('has a field for the inquiry date', function() {
var inquiryDate = fields[1];
assert.ok(inquiryDate.tagName, 'LABELED-DATE-FIELD', 'is a labeled date field');
assert.equal(inquiryDate.textContent, 'Data depunerii cererii',
'has the appropriate label');
assert.equal(getDOMValue(inquiryDate), fieldValues['data-depunerii'],
'is prefilled with the appropriate value');
});
示例3: function
return function(field, i) {
var fieldElement = fieldElements[i];
var expectedLabel = field[0];
var expectedTagName = field[1];
var internalName = field[2];
var expectedValue = fieldValues[internalName];
var orderNo = i + 1;
var messagePrefix = 'field #' + orderNo + ' — ' + internalName + ' — ';
assert.equal(getLabel(fieldElement), expectedLabel, messagePrefix + 'has the appropriate label');
assert.equal(getTagName(fieldElement), expectedTagName, messagePrefix + 'is of the appropriate kind');
assert.equal(getDOMValue(fieldElement), expectedValue, messagePrefix + 'is prefilled with the appropriate value');
};
示例4: it
it('has the appropriate fields', function() {
var fieldElements = domElement.querySelectorAll('fieldset>:not(legend)');
var courtField = fieldElements[0];
assert.equal(courtField.tagName, 'LABELED-SELECT-FIELD', 'the first field is a labeled-select-field');
assert.equal(getLabel(courtField), 'Instanţa de judecată', 'the first field is “Instanţa de judecată”');
assert.equal(getDOMValue(courtField), fieldValues['instanţa-de-judecată'],
'the “Instanţa de judecată” field has preselected the given option');
var sentenceNumberField = fieldElements[1];
assert.equal(sentenceNumberField.tagName, 'LABELED-TEXT-FIELD', 'the second field is a labeled-text-field');
assert.equal(getLabel(sentenceNumberField), 'Numărul hotărîrii', 'the second field is “Numărul hotărîrii”');
assert.equal(getDOMValue(sentenceNumberField), fieldValues['numărul-hotărîrii'],
'the “Numărul hotărîrii” field is prefilled with the given value');
var sentenceDateField = fieldElements[2];
assert.equal(sentenceDateField.tagName, 'LABELED-DATE-FIELD', 'the third field is a labeled-date-field');
assert.equal(getLabel(sentenceDateField), 'Data hotărîrii', 'the third field is “Data hotărîrii”');
assert.equal(getDOMValue(sentenceDateField), fieldValues['data-hotărîrii'],
'the “Data hotărîrii” field is prefilled with the given value');
var conclusionField = fieldElements[3];
assert.equal(conclusionField.tagName, 'LABELED-LARGE-TEXT-FIELD', 'the fourth field is a labeled-large-text-field');
assert.equal(getLabel(conclusionField), 'Dispozitivul',
'the fourth field is “Dispozitivul”');
assert.equal(getDOMValue(conclusionField), fieldValues['dispozitivul'],
'the “Dispozitivul” field is prefilled with the given value');
var caseSubjectField = fieldElements[4];
assert.equal(caseSubjectField.tagName, 'LABELED-SELECT-FIELD', 'the fifth field is a labeled-select-field');
assert.equal(getLabel(caseSubjectField), 'Obiectul urmăririi',
'the fifth field is “Obiectul urmăririi”');
assert.equal(getDOMValue(caseSubjectField), fieldValues['obiectul-urmăririi'],
'the “Obiectul urmăririi” field is prefilled with the given value');
var finalSentenceDateField = fieldElements[5];
assert.equal(finalSentenceDateField.tagName, 'LABELED-DATE-FIELD', 'the sixth field is a labeled-date-field');
assert.equal(getLabel(finalSentenceDateField), 'Data rămînerii definitive',
'the sixth field is “Data rămînerii definitive”');
assert.equal(getDOMValue(finalSentenceDateField), fieldValues['data-rămînerii-definitive'],
'the “Data rămînerii definitive” field is prefilled with the given value');
var releaseDateField = fieldElements[6];
assert.equal(releaseDateField.tagName, 'LABELED-DATE-FIELD', 'the seventh field is a labeled-date-field');
assert.equal(getLabel(releaseDateField), 'Data eliberării',
'the sixth field is “Data eliberării”');
assert.equal(getDOMValue(releaseDateField), fieldValues['data-eliberării'],
'the “Data eliberării” field is prefilled with the given value');
});