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


TypeScript helper.getDOMValue函数代码示例

本文整理汇总了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'));
      }
    });
开发者ID:gurdiga,项目名称:xo,代码行数:26,代码来源:PersonSectionTest.ts

示例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');
    });
开发者ID:gurdiga,项目名称:xo,代码行数:9,代码来源:InquirySectionTest.ts

示例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');
    };
开发者ID:gurdiga,项目名称:xo,代码行数:15,代码来源:PersonSectionTest.ts

示例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');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:49,代码来源:SentenceSectionTest.ts


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