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