mirror of https://github.com/docker/docs.git
Fix integration tests
This commit is contained in:
parent
98873e4c5d
commit
a7cf73b813
|
|
@ -26,7 +26,8 @@ describe('RegHubUtil Integration Tests', () => {
|
|||
hubUtil.login(process.env.INTEGRATION_USER, process.env.INTEGRATION_PASSWORD, () => {
|
||||
regHubUtil.tags(`${process.env.INTEGRATION_USER}/test_private`, (error, tags) => {
|
||||
expect(error).toBeFalsy();
|
||||
expect(tags).toEqual(['latest']);
|
||||
expect(tags.length).toEqual(1);
|
||||
expect(tags[0].name).toEqual('latest');
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
|
@ -50,8 +51,10 @@ describe('RegHubUtil Integration Tests', () => {
|
|||
return new Promise((resolve) => {
|
||||
hubUtil.login(process.env.INTEGRATION_USER, process.env.INTEGRATION_PASSWORD, () => {
|
||||
regHubUtil.tags(`${process.env.INTEGRATION_USER}/test`, (error, tags) => {
|
||||
console.log(tags);
|
||||
expect(error).toBeFalsy();
|
||||
expect(tags).toEqual(['latest']);
|
||||
expect(tags.length).toEqual(1);
|
||||
expect(tags[0].name).toEqual('latest');
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ var ImageCard = React.createClass({
|
|||
} else if (self.state.tags.length === 0) {
|
||||
tags = <div className="no-tags">No Tags</div>;
|
||||
} else {
|
||||
var tagDisplay = self.state.tags.map(function (t) {
|
||||
var tagDisplay = self.state.tags.map(function (tag) {
|
||||
let t = tag.name;
|
||||
if (t === self.state.chosenTag) {
|
||||
return <div className="tag active" key={t} onClick={self.handleTagClick.bind(self, t)}>{t}</div>;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ module.exports = {
|
|||
}, (error, response, body) => {
|
||||
if (response.statusCode === 200) {
|
||||
let data = JSON.parse(body);
|
||||
tagServerActions.tagsUpdated({repo, tags: data.tags});
|
||||
if (callback) { callback(null, data.tags); }
|
||||
tagServerActions.tagsUpdated({repo, tags: data});
|
||||
if (callback) { callback(null, data); }
|
||||
} else if (error || response.statusCode === 401) {
|
||||
repositoryServerActions.error({repo});
|
||||
if (callback) { callback(new Error('Failed to fetch repos')); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue