Fix even more specs
This commit is contained in:
parent
809a94f651
commit
f71a1daab9
|
@ -3,6 +3,9 @@ describe 'on the "current" state', ->
|
||||||
app 'travis-ci/travis-core'
|
app 'travis-ci/travis-core'
|
||||||
waitFor buildRendered
|
waitFor buildRendered
|
||||||
|
|
||||||
|
afterEach ->
|
||||||
|
window.history.pushState({}, null, '/spec.html')
|
||||||
|
|
||||||
it 'displays the expected stuff', ->
|
it 'displays the expected stuff', ->
|
||||||
listsRepos [
|
listsRepos [
|
||||||
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||||
|
|
|
@ -1,36 +1,40 @@
|
||||||
# describe 'on the "job" state', ->
|
describe 'on the "job" state', ->
|
||||||
# beforeEach ->
|
beforeEach ->
|
||||||
# app '!/travis-ci/travis-core/jobs/1'
|
app 'travis-ci/travis-core/jobs/1'
|
||||||
# waitFor jobRendered
|
waitFor jobRendered
|
||||||
# waitFor hasText('#tab_build', 'Build #1')
|
runs ->
|
||||||
#
|
waitFor hasText('#tab_build', 'Build #1')
|
||||||
# it 'displays the expected stuff', ->
|
|
||||||
# listsRepos [
|
afterEach ->
|
||||||
# { slug: 'travis-ci/travis-core', build: { number: 1, url: '#!/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
window.history.pushState({}, null, '/spec.html')
|
||||||
# { slug: 'travis-ci/travis-assets', build: { number: 3, url: '#!/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
|
||||||
# { slug: 'travis-ci/travis-hub', build: { number: 4, url: '#!/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
it 'displays the expected stuff', ->
|
||||||
# ]
|
listsRepos [
|
||||||
#
|
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||||
# displaysRepository
|
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
||||||
# href: 'http://github.com/travis-ci/travis-core'
|
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
||||||
#
|
]
|
||||||
# displaysSummary
|
|
||||||
# id: 1
|
displaysRepository
|
||||||
# type: 'job'
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
# repo: 'travis-ci/travis-core'
|
|
||||||
# commit: '1234567'
|
displaysSummary
|
||||||
# branch: 'master'
|
id: 1
|
||||||
# compare: '0123456..1234567'
|
type: 'job'
|
||||||
# finishedAt: '3 minutes ago'
|
repo: 'travis-ci/travis-core'
|
||||||
# duration: '30 sec'
|
commit: '1234567'
|
||||||
# message: 'commit message 1'
|
branch: 'master'
|
||||||
#
|
compare: '0123456..1234567'
|
||||||
# displaysTabs
|
finishedAt: '3 minutes ago'
|
||||||
# current: { href: '#!/travis-ci/travis-core' }
|
duration: '30 sec'
|
||||||
# builds: { href: '#!/travis-ci/travis-core/builds' }
|
message: 'commit message 1'
|
||||||
# build: { href: '#!/travis-ci/travis-core/builds/1' }
|
|
||||||
# job: { href: '#!/travis-ci/travis-core/jobs/1', active: true }
|
displaysTabs
|
||||||
#
|
current: { href: '/travis-ci/travis-core' }
|
||||||
# displaysLog [
|
builds: { href: '/travis-ci/travis-core/builds' }
|
||||||
# 'log 1'
|
build: { href: '/travis-ci/travis-core/builds/1' }
|
||||||
# ]
|
job: { href: '/travis-ci/travis-core/jobs/1', active: true }
|
||||||
|
|
||||||
|
displaysLog [
|
||||||
|
'log 1'
|
||||||
|
]
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
# describe 'the sidebar', ->
|
describe 'the sidebar', ->
|
||||||
# beforeEach ->
|
beforeEach ->
|
||||||
# app '!/travis-ci/travis-core/jobs/1'
|
app 'travis-ci/travis-core/jobs/1'
|
||||||
# waitFor jobRendered
|
waitFor jobRendered
|
||||||
# waitFor hasText('#tab_build', 'Build #1')
|
runs ->
|
||||||
#
|
waitFor hasText('#tab_build', 'Build #1')
|
||||||
# it 'displays the expected stuff', ->
|
|
||||||
# listsQueues [
|
afterEach ->
|
||||||
# { name: 'common', item: { number: '5.1', repo: 'travis-ci/travis-core' } }
|
window.history.pushState({}, null, '/spec.html')
|
||||||
# { name: 'common', item: { number: '5.2', repo: 'travis-ci/travis-core' } }
|
|
||||||
# ]
|
it 'displays the expected stuff', ->
|
||||||
|
listsQueues [
|
||||||
|
{ name: 'common', item: { number: '5.1', repo: 'travis-ci/travis-core' } }
|
||||||
|
{ name: 'common', item: { number: '5.2', repo: 'travis-ci/travis-core' } }
|
||||||
|
]
|
||||||
|
|
|
@ -105,9 +105,17 @@
|
||||||
expect(text).toContain job.repo
|
expect(text).toContain job.repo
|
||||||
expect(text).toContain "##{job.number}"
|
expect(text).toContain "##{job.number}"
|
||||||
|
|
||||||
|
@listsQueue = (data) ->
|
||||||
|
name = data.item.name
|
||||||
|
job = data.item.item
|
||||||
|
text = $($("#queue_#{name} li")[data.row - 1]).text()
|
||||||
|
expect(text).toContain job.repo
|
||||||
|
expect(text).toContain "##{job.number}"
|
||||||
|
|
||||||
@listsItems = (type, items) ->
|
@listsItems = (type, items) ->
|
||||||
$.each items, (row, item) =>
|
$.each items, (row, item) =>
|
||||||
this["lists#{$.camelize(type)}"](item: item, row: row + 1)
|
this["lists#{$.camelize(type)}"](item: item, row: row + 1)
|
||||||
|
|
||||||
|
@listsQueues = (queues) ->
|
||||||
|
listsItems('queue', queues)
|
||||||
|
|
||||||
|
|
|
@ -200,6 +200,9 @@
|
||||||
app('travis-ci/travis-core');
|
app('travis-ci/travis-core');
|
||||||
return waitFor(buildRendered);
|
return waitFor(buildRendered);
|
||||||
});
|
});
|
||||||
|
afterEach(function() {
|
||||||
|
return window.history.pushState({}, null, '/spec.html');
|
||||||
|
});
|
||||||
return it('displays the expected stuff', function() {
|
return it('displays the expected stuff', function() {
|
||||||
listsRepos([
|
listsRepos([
|
||||||
{
|
{
|
||||||
|
@ -415,12 +418,110 @@
|
||||||
}).call(this);
|
}).call(this);
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
describe('on the "job" state', function() {
|
||||||
|
beforeEach(function() {
|
||||||
|
app('travis-ci/travis-core/jobs/1');
|
||||||
|
waitFor(jobRendered);
|
||||||
|
return runs(function() {
|
||||||
|
return waitFor(hasText('#tab_build', 'Build #1'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
afterEach(function() {
|
||||||
|
return window.history.pushState({}, null, '/spec.html');
|
||||||
|
});
|
||||||
|
return it('displays the expected stuff', function() {
|
||||||
|
listsRepos([
|
||||||
|
{
|
||||||
|
slug: 'travis-ci/travis-hub',
|
||||||
|
build: {
|
||||||
|
number: 4,
|
||||||
|
url: '/travis-ci/travis-hub/builds/4',
|
||||||
|
duration: '1 min',
|
||||||
|
finishedAt: '-'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
slug: 'travis-ci/travis-core',
|
||||||
|
build: {
|
||||||
|
number: 1,
|
||||||
|
url: '/travis-ci/travis-core/builds/1',
|
||||||
|
duration: '30 sec',
|
||||||
|
finishedAt: '3 minutes ago'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
slug: 'travis-ci/travis-assets',
|
||||||
|
build: {
|
||||||
|
number: 3,
|
||||||
|
url: '/travis-ci/travis-assets/builds/3',
|
||||||
|
duration: '30 sec',
|
||||||
|
finishedAt: 'a day ago'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
displaysRepository({
|
||||||
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
});
|
||||||
|
displaysSummary({
|
||||||
|
id: 1,
|
||||||
|
type: 'job',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
commit: '1234567',
|
||||||
|
branch: 'master',
|
||||||
|
compare: '0123456..1234567',
|
||||||
|
finishedAt: '3 minutes ago',
|
||||||
|
duration: '30 sec',
|
||||||
|
message: 'commit message 1'
|
||||||
|
});
|
||||||
|
displaysTabs({
|
||||||
|
current: {
|
||||||
|
href: '/travis-ci/travis-core'
|
||||||
|
},
|
||||||
|
builds: {
|
||||||
|
href: '/travis-ci/travis-core/builds'
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
href: '/travis-ci/travis-core/builds/1'
|
||||||
|
},
|
||||||
|
job: {
|
||||||
|
href: '/travis-ci/travis-core/jobs/1',
|
||||||
|
active: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return displaysLog(['log 1']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
describe('the sidebar', function() {
|
||||||
|
beforeEach(function() {
|
||||||
|
app('travis-ci/travis-core/jobs/1');
|
||||||
|
waitFor(jobRendered);
|
||||||
|
return runs(function() {
|
||||||
|
return waitFor(hasText('#tab_build', 'Build #1'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
afterEach(function() {
|
||||||
|
return window.history.pushState({}, null, '/spec.html');
|
||||||
|
});
|
||||||
|
return it('displays the expected stuff', function() {
|
||||||
|
return listsQueues([
|
||||||
|
{
|
||||||
|
name: 'common',
|
||||||
|
item: {
|
||||||
|
number: '5.1',
|
||||||
|
repo: 'travis-ci/travis-core'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
name: 'common',
|
||||||
|
item: {
|
||||||
|
number: '5.2',
|
||||||
|
repo: 'travis-ci/travis-core'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -636,6 +737,15 @@
|
||||||
return expect(text).toContain("#" + job.number);
|
return expect(text).toContain("#" + job.number);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.listsQueue = function(data) {
|
||||||
|
var job, name, text;
|
||||||
|
name = data.item.name;
|
||||||
|
job = data.item.item;
|
||||||
|
text = $($("#queue_" + name + " li")[data.row - 1]).text();
|
||||||
|
expect(text).toContain(job.repo);
|
||||||
|
return expect(text).toContain("#" + job.number);
|
||||||
|
};
|
||||||
|
|
||||||
this.listsItems = function(type, items) {
|
this.listsItems = function(type, items) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
return $.each(items, function(row, item) {
|
return $.each(items, function(row, item) {
|
||||||
|
@ -646,6 +756,10 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.listsQueues = function(queues) {
|
||||||
|
return listsItems('queue', queues);
|
||||||
|
};
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user