"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 = 'Textarea Test Suite';
var selectors = {
  input: 'textarea[placeholder="Uncontrolled textarea"]'
};
describe('The textarea component', function () {
  after(function (browser, done) {
    browser.end(function () {
      return done();
    });
  });
  xit('passes basic a11y tests', function (browser) {
    goToUrl({
      suite: suite,
      test: scenarios.SIMPLE_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.SIMPLE_EXAMPLE,
      browser: browser
    }).waitForElementVisible(selectors.input).getValue(selectors.input, function (result) {
      this.assert.equal(result.value, 'initial value');
    });
  });
  it('entered value is displayed', function (browser) {
    goToUrl({
      suite: suite,
      test: scenarios.SIMPLE_EXAMPLE,
      browser: browser
    }).waitForElementVisible(selectors.input).setValue(selectors.input, ' updated').getValue(selectors.input, function (result) {
      this.assert.equal(result.value, 'initial value updated');
    });
  });
});