Commit be83c8ea authored by Mike Greiling's avatar Mike Greiling

Merge branch 'leipert-absolute-scss-paths' into 'master'

Use absolute paths for SCSS imports

See merge request gitlab-org/gitlab-ce!30161
parents 1cd8fb49 2643d3b3
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
// like a table or typography then make changes in the framework/ directory. // like a table or typography then make changes in the framework/ directory.
// If you need to add unique style that should affect only one page - use pages/ // If you need to add unique style that should affect only one page - use pages/
// directory. // directory.
@import "../../../node_modules/at.js/dist/css/jquery.atwho"; @import "at.js/dist/css/jquery.atwho";
@import "../../../node_modules/pikaday/scss/pikaday"; @import "pikaday/scss/pikaday";
@import "../../../node_modules/dropzone/dist/basic"; @import "dropzone/dist/basic";
@import "../../../node_modules/select2/select2"; @import "select2/select2";
// GitLab UI framework // GitLab UI framework
@import "framework"; @import "framework";
......
@import "../../../node_modules/@gitlab/csslab/dist/css/csslab-slim"; @import "@gitlab/csslab/dist/css/csslab-slim";
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* This is a minimal stylesheet, meant to be used for error pages. * This is a minimal stylesheet, meant to be used for error pages.
*/ */
@import 'framework/variables'; @import 'framework/variables';
@import '../../../node_modules/bootstrap/scss/functions'; @import 'bootstrap/scss/functions';
@import '../../../node_modules/bootstrap/scss/variables'; @import 'bootstrap/scss/variables';
@import '../../../node_modules/bootstrap/scss/mixins'; @import 'bootstrap/scss/mixins';
@import '../../../node_modules/bootstrap/scss/reboot'; @import 'bootstrap/scss/reboot';
@import '../../../node_modules/bootstrap/scss/buttons'; @import 'bootstrap/scss/buttons';
@import '../../../node_modules/bootstrap/scss/forms'; @import 'bootstrap/scss/forms';
$body-color: #666; $body-color: #666;
$header-color: #456; $header-color: #456;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
@import 'framework/variables_overrides'; @import 'framework/variables_overrides';
@import 'framework/mixins'; @import 'framework/mixins';
@import '../../../node_modules/@gitlab/ui/scss/gitlab_ui'; @import '@gitlab/ui/scss/gitlab_ui';
@import 'bootstrap_migration'; @import 'bootstrap_migration';
@import 'framework/layout'; @import 'framework/layout';
......
...@@ -3,6 +3,7 @@ import * as jqueryMatchers from 'custom-jquery-matchers'; ...@@ -3,6 +3,7 @@ import * as jqueryMatchers from 'custom-jquery-matchers';
import $ from 'jquery'; import $ from 'jquery';
import Translate from '~/vue_shared/translate'; import Translate from '~/vue_shared/translate';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { config as testUtilsConfig } from '@vue/test-utils';
import { initializeTestTimeout } from './helpers/timeout'; import { initializeTestTimeout } from './helpers/timeout';
import { loadHTMLFixture, setHTMLFixture } from './helpers/fixtures'; import { loadHTMLFixture, setHTMLFixture } from './helpers/fixtures';
...@@ -60,9 +61,21 @@ Object.assign(global, { ...@@ -60,9 +61,21 @@ Object.assign(global, {
preloadFixtures() {}, preloadFixtures() {},
}); });
Object.assign(global, {
MutationObserver() {
return {
disconnect() {},
observe() {},
};
},
});
// custom-jquery-matchers was written for an old Jest version, we need to make it compatible // custom-jquery-matchers was written for an old Jest version, we need to make it compatible
Object.entries(jqueryMatchers).forEach(([matcherName, matcherFactory]) => { Object.entries(jqueryMatchers).forEach(([matcherName, matcherFactory]) => {
expect.extend({ expect.extend({
[matcherName]: matcherFactory().compare, [matcherName]: matcherFactory().compare,
}); });
}); });
// Tech debt issue TBD
testUtilsConfig.logModifiedComponents = false;
...@@ -241,7 +241,7 @@ describe('Dashboard', () => { ...@@ -241,7 +241,7 @@ describe('Dashboard', () => {
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
const dropdownItems = component.$el.querySelectorAll( const dropdownItems = component.$el.querySelectorAll(
'.js-environments-dropdown .dropdown-item.is-active', '.js-environments-dropdown .dropdown-item.active',
); );
expect(dropdownItems.length).toEqual(1); expect(dropdownItems.length).toEqual(1);
......
...@@ -72,21 +72,15 @@ describe('collapsible registry container', () => { ...@@ -72,21 +72,15 @@ describe('collapsible registry container', () => {
expect(findDeleteBtn()).not.toBeNull(); expect(findDeleteBtn()).not.toBeNull();
}); });
describe('clicked on delete', () => { it('should call deleteItem when confirming deletion', done => {
beforeEach(done => { findDeleteBtn().click();
findDeleteBtn().click(); spyOn(vm, 'deleteItem').and.returnValue(Promise.resolve());
Vue.nextTick(done);
});
it('should open confirmation modal', () => {
expect(vm.$el.querySelector('#confirm-repo-deletion-modal')).not.toBeNull();
});
it('should call deleteItem when confirming deletion', () => { Vue.nextTick(() => {
spyOn(vm, 'deleteItem').and.returnValue(Promise.resolve()); document.querySelector('#confirm-repo-deletion-modal .btn-danger').click();
vm.$el.querySelector('#confirm-repo-deletion-modal .btn-danger').click();
expect(vm.deleteItem).toHaveBeenCalledWith(vm.repo); expect(vm.deleteItem).toHaveBeenCalledWith(vm.repo);
done();
}); });
}); });
}); });
......
...@@ -46,23 +46,16 @@ describe('table registry', () => { ...@@ -46,23 +46,16 @@ describe('table registry', () => {
expect(findDeleteBtn()).toBeDefined(); expect(findDeleteBtn()).toBeDefined();
}); });
describe('clicked on delete', () => { it('should call deleteItem and reset itemToBeDeleted when confirming deletion', done => {
beforeEach(done => { findDeleteBtn().click();
findDeleteBtn().click(); spyOn(vm, 'deleteItem').and.returnValue(Promise.resolve());
Vue.nextTick(done);
});
it('should open confirmation modal and set itemToBeDeleted properly', () => {
expect(vm.itemToBeDeleted).toEqual(firstImage);
expect(vm.$el.querySelector('#confirm-image-deletion-modal')).not.toBeNull();
});
it('should call deleteItem and reset itemToBeDeleted when confirming deletion', () => { Vue.nextTick(() => {
spyOn(vm, 'deleteItem').and.returnValue(Promise.resolve()); document.querySelector('#confirm-image-deletion-modal .btn-danger').click();
vm.$el.querySelector('#confirm-image-deletion-modal .btn-danger').click();
expect(vm.deleteItem).toHaveBeenCalledWith(firstImage); expect(vm.deleteItem).toHaveBeenCalledWith(firstImage);
expect(vm.itemToBeDeleted).toBeNull(); expect(vm.itemToBeDeleted).toBeNull();
done();
}); });
}); });
}); });
......
...@@ -10,12 +10,16 @@ import VueResource from 'vue-resource'; ...@@ -10,12 +10,16 @@ import VueResource from 'vue-resource';
import Translate from '~/vue_shared/translate'; import Translate from '~/vue_shared/translate';
import CheckEE from '~/vue_shared/mixins/is_ee'; import CheckEE from '~/vue_shared/mixins/is_ee';
import jasmineDiff from 'jasmine-diff'; import jasmineDiff from 'jasmine-diff';
import { config as testUtilsConfig } from '@vue/test-utils';
import { getDefaultAdapter } from '~/lib/utils/axios_utils'; import { getDefaultAdapter } from '~/lib/utils/axios_utils';
import { FIXTURES_PATH, TEST_HOST } from './test_constants'; import { FIXTURES_PATH, TEST_HOST } from './test_constants';
import customMatchers from './matchers'; import customMatchers from './matchers';
// Tech debt issue TBD
testUtilsConfig.logModifiedComponents = false;
const isHeadlessChrome = /\bHeadlessChrome\//.test(navigator.userAgent); const isHeadlessChrome = /\bHeadlessChrome\//.test(navigator.userAgent);
Vue.config.devtools = !isHeadlessChrome; Vue.config.devtools = !isHeadlessChrome;
Vue.config.productionTip = false; Vue.config.productionTip = false;
......
This diff is collapsed.
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