2018-03-27 19:54:05 +05:30
|
|
|
import initSettingsPanels from '~/settings_panels';
|
|
|
|
|
|
|
|
describe('Settings Panels', () => {
|
|
|
|
preloadFixtures('projects/ci_cd_settings.html.raw');
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
loadFixtures('projects/ci_cd_settings.html.raw');
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('initSettingsPane', () => {
|
|
|
|
afterEach(() => {
|
|
|
|
location.hash = '';
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should expand linked hash fragment panel', () => {
|
2018-10-15 14:42:47 +05:30
|
|
|
location.hash = '#autodevops-settings';
|
2018-03-27 19:54:05 +05:30
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
const pipelineSettingsPanel = document.querySelector('#autodevops-settings');
|
2018-03-27 19:54:05 +05:30
|
|
|
// Our test environment automatically expands everything so we need to clear that out first
|
|
|
|
pipelineSettingsPanel.classList.remove('expanded');
|
|
|
|
|
|
|
|
expect(pipelineSettingsPanel.classList.contains('expanded')).toBe(false);
|
|
|
|
|
|
|
|
initSettingsPanels();
|
|
|
|
|
|
|
|
expect(pipelineSettingsPanel.classList.contains('expanded')).toBe(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|