Commit bd816682 authored by Minh Nguyen's avatar Minh Nguyen Committed by Nathan Friend

Expand nested stopped environments

parent e812cfc1
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
this.store.updateEnvironmentProp(folder, 'isLoadingFolderContent', showLoader); this.store.updateEnvironmentProp(folder, 'isLoadingFolderContent', showLoader);
this.service this.service
.getFolderContent(folder.folder_path) .getFolderContent(folder.folder_path, folder.state)
.then((response) => this.store.setfolderContent(folder, response.data.environments)) .then((response) => this.store.setfolderContent(folder, response.data.environments))
.then(() => this.store.updateEnvironmentProp(folder, 'isLoadingFolderContent', false)) .then(() => this.store.updateEnvironmentProp(folder, 'isLoadingFolderContent', false))
.catch(() => { .catch(() => {
......
...@@ -21,7 +21,7 @@ export default class EnvironmentsService { ...@@ -21,7 +21,7 @@ export default class EnvironmentsService {
return axios.delete(endpoint, {}); return axios.delete(endpoint, {});
} }
getFolderContent(folderUrl) { getFolderContent(folderUrl, scope) {
return axios.get(`${folderUrl}.json?per_page=${this.folderResults}`); return axios.get(`${folderUrl}.json?per_page=${this.folderResults}&scope=${scope}`);
} }
} }
---
title: Expand nested stopped environments
merge_request: 55676
author:
type: changed
...@@ -429,6 +429,7 @@ RSpec.describe 'Environments page', :js do ...@@ -429,6 +429,7 @@ RSpec.describe 'Environments page', :js do
end end
describe 'environments folders' do describe 'environments folders' do
describe 'available environments' do
before do before do
create(:environment, :will_auto_stop, create(:environment, :will_auto_stop,
project: project, project: project,
...@@ -464,6 +465,35 @@ RSpec.describe 'Environments page', :js do ...@@ -464,6 +465,35 @@ RSpec.describe 'Environments page', :js do
end end
end end
describe 'stopped environments' do
before do
create(:environment, :will_auto_stop,
project: project,
name: 'staging/review-1',
state: :stopped)
create(:environment, :will_auto_stop,
project: project,
name: 'staging/review-2',
state: :stopped)
end
it 'users unfurls an environment folder' do
visit_environments(project, scope: 'stopped')
expect(page).not_to have_content 'review-1'
expect(page).not_to have_content 'review-2'
expect(page).to have_content 'staging 2'
within('.folder-row') do
find('.folder-name', text: 'staging').click
end
expect(page).to have_content 'review-1'
expect(page).to have_content 'review-2'
end
end
end
describe 'environments folders view' do describe 'environments folders view' do
before do before do
create(:environment, project: project, create(:environment, project: project,
......
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