Commit 95a907b4 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '230615-spec-environments-active-item' into 'master'

Fix ignored spec for select environment

Closes #230615

See merge request gitlab-org/gitlab!38133
parents f0288d79 0cf0c0e6
...@@ -124,11 +124,13 @@ describe('Dashboard header', () => { ...@@ -124,11 +124,13 @@ describe('Dashboard header', () => {
describe('when environments data is loaded', () => { describe('when environments data is loaded', () => {
const currentDashboard = dashboardGitResponse[0].path; const currentDashboard = dashboardGitResponse[0].path;
const currentEnvironmentName = environmentData[0].name;
beforeEach(() => { beforeEach(() => {
setupStoreWithData(store); setupStoreWithData(store);
store.state.monitoringDashboard.projectPath = mockProjectPath; store.state.monitoringDashboard.projectPath = mockProjectPath;
store.state.monitoringDashboard.currentDashboard = currentDashboard; store.state.monitoringDashboard.currentDashboard = currentDashboard;
store.state.monitoringDashboard.currentEnvironmentName = currentEnvironmentName;
return wrapper.vm.$nextTick(); return wrapper.vm.$nextTick();
}); });
...@@ -145,15 +147,13 @@ describe('Dashboard header', () => { ...@@ -145,15 +147,13 @@ describe('Dashboard header', () => {
}); });
}); });
// Note: This test is not working, .active does not show the active environment it('renders the environments dropdown with an active element', () => {
// https://gitlab.com/gitlab-org/gitlab/-/issues/230615 const selectedItems = findEnvsDropdownItems().filter(
// eslint-disable-next-line jest/no-disabled-tests item => item.attributes('active') === 'true',
it.skip('renders the environments dropdown with a single active element', () => {
const activeItem = findEnvsDropdownItems().wrappers.filter(itemWrapper =>
itemWrapper.find('.active').exists(),
); );
expect(activeItem.length).toBe(1); expect(selectedItems.length).toBe(1);
expect(selectedItems.at(0).text()).toBe(currentEnvironmentName);
}); });
it('filters rendered dropdown items', () => { it('filters rendered dropdown items', () => {
......
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