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', {
return {
store,
service: {},
folderName,
endpoint,
state: store.state,
......@@ -88,11 +89,11 @@ module.exports = Vue.component('environment-folder-view', {
const endpoint = `${this.endpoint}?scope=${scope}&page=${pageNumber}`;
const service = new EnvironmentsService(endpoint);
this.service = new EnvironmentsService(endpoint);
this.isLoading = true;
return service.all()
return this.service.all()
.then(resp => ({
headers: resp.headers,
body: resp.json(),
......@@ -182,7 +183,7 @@ module.exports = Vue.component('environment-folder-view', {
:commit-icon-svg="commitIconSvg"
:toggleDeployBoard="toggleDeployBoard"
:store="store"
:service="service>
:service="service">
</environment-table>
<table-pagination v-if="state.paginationInformation && state.paginationInformation.totalPages > 1"
......
......@@ -49,7 +49,7 @@ describe('Environment', () => {
});
});
describe('with paginated environments', () => {
describe('with environments', () => {
const environmentsResponseInterceptor = (request, next) => {
next(request.respondWith(JSON.stringify({
environments: [environment],
......@@ -142,6 +142,17 @@ describe('Environment', () => {
}, 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', () => {
}, 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', () => {
......
......@@ -12,6 +12,7 @@ const environmentsList = [
stop_path: '/root/review-app/environments/7/stop',
created_at: '2017-01-31T10:53:46.894Z',
updated_at: '2017-01-31T10:53:46.894Z',
rollout_status_path: '/path',
},
{
folderName: 'build',
......@@ -82,6 +83,7 @@ const environment = {
stop_path: '/root/review-app/environments/7/stop',
created_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