travis-web/tests/unit/components/owner-repo-tile-test.js
Curtis Ekstrom 9d429966d0 Remove append() test deprecations
Replacing with `render` to appease the test suite gods.
2016-02-04 00:06:47 +01:00

39 lines
1.4 KiB
JavaScript

// Generated by CoffeeScript 1.10.0
import { test, moduleForComponent } from 'ember-qunit';
moduleForComponent('owner-repo-tile', 'OwnerRepoTileComponent', {
needs: ['helper:format-time', 'helper:format-duration', 'helper:format-sha', 'component:status-icon', 'component:request-icon']
});
test('it renders', function() {
var attributes, component;
attributes = {
slug: "travis-ci/travis-chat",
active: false,
"private": false,
default_branch: {
name: "master",
last_build: {
number: "25",
state: "passed",
duration: 252,
event_type: "push",
previous_state: "passed",
started_at: "2013-07-08T11:03:19Z",
finished_at: "2013-07-08T11:06:50Z",
commit: {
sha: "16fff347ff55403caf44c53357855ebc32adf95d",
compare_url: "https://github.com/travis-ci/travis-chat/compare/3c4e9ea50141...16fff347ff55"
}
}
}
};
component = this.subject({
repo: attributes
});
this.render();
ok(component.$().hasClass('passed'), 'component should have state class (passed)');
equal(component.$('.row-item:nth-of-type(1)').text().trim(), 'travis-chat', 'should display correct repo name');
equal(component.$('.row-item:nth-of-type(3)').text().trim(), 'master', 'should display branch name');
return equal(component.$('.row-item:nth-of-type(4)').text().trim(), '16fff34', 'should display correct commit sha');
});