Commit e89b6eea authored by Filipa Lacerda's avatar Filipa Lacerda

Adds tests for ability to render deploy boards

parent 61517b8e
...@@ -26,6 +26,7 @@ module.exports = Vue.component('environment-folder-view', { ...@@ -26,6 +26,7 @@ module.exports = Vue.component('environment-folder-view', {
return { return {
store, store,
service: {},
folderName, folderName,
endpoint, endpoint,
state: store.state, state: store.state,
...@@ -88,11 +89,11 @@ module.exports = Vue.component('environment-folder-view', { ...@@ -88,11 +89,11 @@ module.exports = Vue.component('environment-folder-view', {
const endpoint = `${this.endpoint}?scope=${scope}&page=${pageNumber}`; const endpoint = `${this.endpoint}?scope=${scope}&page=${pageNumber}`;
const service = new EnvironmentsService(endpoint); this.service = new EnvironmentsService(endpoint);
this.isLoading = true; this.isLoading = true;
return service.all() return this.service.all()
.then(resp => ({ .then(resp => ({
headers: resp.headers, headers: resp.headers,
body: resp.json(), body: resp.json(),
...@@ -182,7 +183,7 @@ module.exports = Vue.component('environment-folder-view', { ...@@ -182,7 +183,7 @@ module.exports = Vue.component('environment-folder-view', {
:commit-icon-svg="commitIconSvg" :commit-icon-svg="commitIconSvg"
:toggleDeployBoard="toggleDeployBoard" :toggleDeployBoard="toggleDeployBoard"
:store="store" :store="store"
:service="service> :service="service">
</environment-table> </environment-table>
<table-pagination v-if="state.paginationInformation && state.paginationInformation.totalPages > 1" <table-pagination v-if="state.paginationInformation && state.paginationInformation.totalPages > 1"
......
...@@ -49,7 +49,7 @@ describe('Environment', () => { ...@@ -49,7 +49,7 @@ describe('Environment', () => {
}); });
}); });
describe('with paginated environments', () => { describe('with environments', () => {
const environmentsResponseInterceptor = (request, next) => { const environmentsResponseInterceptor = (request, next) => {
next(request.respondWith(JSON.stringify({ next(request.respondWith(JSON.stringify({
environments: [environment], environments: [environment],
...@@ -142,6 +142,17 @@ describe('Environment', () => { ...@@ -142,6 +142,17 @@ describe('Environment', () => {
}, 0); }, 0);
}); });
}); });
describe('deploy boards', () => {
it('should render arrow to open deploy boards', (done) => {
setTimeout(() => {
expect(
component.$el.querySelector('.deploy-board-icon i').classList.contains('fa-caret-right'),
).toEqual(true);
done();
}, 0);
});
});
}); });
}); });
......
...@@ -141,6 +141,17 @@ describe('Environments Folder View', () => { ...@@ -141,6 +141,17 @@ describe('Environments Folder View', () => {
}, 0); }, 0);
}); });
}); });
describe('deploy boards', () => {
it('should render arrow to open deploy boards', (done) => {
setTimeout(() => {
expect(
component.$el.querySelector('.deploy-board-icon i').classList.contains('fa-caret-right'),
).toEqual(true);
done();
}, 0);
});
});
}); });
describe('unsuccessfull request', () => { describe('unsuccessfull request', () => {
......
...@@ -12,6 +12,7 @@ const environmentsList = [ ...@@ -12,6 +12,7 @@ const environmentsList = [
stop_path: '/root/review-app/environments/7/stop', stop_path: '/root/review-app/environments/7/stop',
created_at: '2017-01-31T10:53:46.894Z', created_at: '2017-01-31T10:53:46.894Z',
updated_at: '2017-01-31T10:53:46.894Z', updated_at: '2017-01-31T10:53:46.894Z',
rollout_status_path: '/path',
}, },
{ {
folderName: 'build', folderName: 'build',
...@@ -82,6 +83,7 @@ const environment = { ...@@ -82,6 +83,7 @@ const environment = {
stop_path: '/root/review-app/environments/7/stop', stop_path: '/root/review-app/environments/7/stop',
created_at: '2017-01-31T10:53:46.894Z', created_at: '2017-01-31T10:53:46.894Z',
updated_at: '2017-01-31T10:53:46.894Z', updated_at: '2017-01-31T10:53:46.894Z',
rollout_status_path: '/path',
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment