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(() => {
|
|
|
|
location.hash = '';
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should expand linked hash fragment panel', () => {
|
2018-04-17 12:37:16 -04:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|