{"size": 994, "ext": "js", "max_stars_repo_path": "tests/integration/components/pretty-color-test.js", "max_stars_repo_name": "toddjordan/ember-testing-guide-examples", "max_stars_repo_stars_event_min_datetime": "2015-12-15T11:19:40.000Z", "max_stars_repo_stars_event_max_datetime": "2017-02-20T16:48:00.000Z", "max_issues_repo_path": "tests/integration/components/pretty-color-test.js", "max_issues_repo_name": "toddjordan/ember-testing-guide-examples", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tests/integration/components/pretty-color-test.js", "max_forks_repo_name": "toddjordan/ember-testing-guide-examples", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.8648648649, "max_line_length": 88, "alphanum_fraction": 0.6659959759}
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('pretty-color', 'Integration | Component | pretty color', {
  integration: true
});

test('should be rendered with its color name', function(assert) {
  assert.expect(2);

  this.set('colorValue', 'orange');

  this.render(hbs`{{pretty-color name=colorValue}}`);

  assert.equal(this.$().text().trim(), 'Pretty Color: orange', 'text starts as orange');

  this.set('colorValue', 'green');

  assert.equal(this.$().text().trim(), 'Pretty Color: green', 'text switches to green');

});

test('should change colors', function(assert) {
  assert.expect(2);

  // set the outer context to red
  this.set('colorValue', 'red');

  this.render(hbs`{{pretty-color name=colorValue}}`);

  assert.equal(this.$('div').attr('style'), 'color: red', 'starts as red');

  this.set('colorValue', 'blue');

  assert.equal(this.$('div').attr('style'), 'color: blue', 'updates to blue');
});
