2018-02-12 20:30:03 -05:00
|
|
|
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(() => {
|
2018-06-15 11:58:27 -04:00
|
|
|
window.location.hash = '';
|
2018-02-12 20:30:03 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should expand linked hash fragment panel', () => {
|
2018-06-15 11:58:27 -04:00
|
|
|
window.location.hash = '#autodevops-settings';
|
2018-02-12 20:30:03 -05:00
|
|
|
|
2018-04-17 12:37:16 -04:00
|
|
|
const pipelineSettingsPanel = document.querySelector('#autodevops-settings');
|
2018-02-12 20:30:03 -05:00
|
|
|
// 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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|