"use strict";

/*
Copyright (c) 2018 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/

/* eslint-env node */

/* eslint-disable flowtype/require-valid-file-annotation */

/* global after */
var scenarios = require('./examples-list');

var _require = require('../../e2e/helpers'),
    goToUrl = _require.goToUrl;

var suite = 'Input Test Suite';
var selectors = {
  input: 'input[data-test="e2e"]'
};
describe('The input component', function () {
  after(function (browser, done) {
    browser.end(function () {
      return done();
    });
  });
  xit('passes basic a11y tests', function (browser) {
    goToUrl({
      suite: suite,
      test: scenarios.STATE_EXAMPLE,
      browser: browser
    }).initAccessibility().waitForElementVisible(selectors.input).assert.accessibility('html', {
      rules: {
        label: {
          enabled: false
        }
      }
    });
  });
  it('preset value is displayed', function (browser) {
    goToUrl({
      suite: suite,
      test: scenarios.STATE_EXAMPLE,
      browser: browser
    }).waitForElementVisible(selectors.input).getValue(selectors.input, function (result) {
      this.assert.equal(result.value, 'uber');
    });
  });
  it('entered value is displayed', function (browser) {
    goToUrl({
      suite: suite,
      test: scenarios.STATE_EXAMPLE,
      browser: browser
    }).waitForElementVisible(selectors.input).setValue(selectors.input, '_good').getValue(selectors.input, function (result) {
      this.assert.equal(result.value, 'uber_good');
    });
  });
});