diff --git a/.eslintrc.yml b/.eslintrc.yml index d8b869d91..13fc2b140 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -9,7 +9,7 @@ env: rules: require-jsdoc: 0 no-undef: 0 - max-len: 0 + max-len: ["error", {code: 120}] eqeqeq: 0 operator-linebreak: 0 radix: 0 @@ -17,7 +17,7 @@ rules: camelcase: 0 default-case: 0 no-eq-null: 0 - no-console: 0 + no-console: ["error"] no-warning-comments: 0 no-empty: [error, allowEmptyCatch: true] complexity: 0 diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 133801f38..1539aca85 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -94,6 +94,19 @@ let actions = { login: async function(userName) { await this.doLogin(userName); await this.waitForState('home'); + await this.addStyleTag({ + content: ` + *, + *::after, + *::before { + transition-delay: 0s !important; + transition-duration: 0s !important; + animation-delay: -0.0001s !important; + animation-duration: 0s !important; + animation-play-state: paused !important; + caret-color: transparent !important; + }` + }); }, selectModule: async function(moduleName) { @@ -208,7 +221,8 @@ let actions = { waitPropertyLength: async function(selector, property, minLength) { await this.waitForFunction((selector, property, minLength) => { const element = document.querySelector(selector); - return element && element[property] != null && element[property] !== '' && element[property].length >= minLength; + const isValidElement = element && element[property] != null && element[property] !== ''; + return isValidElement && element[property].length >= minLength; }, {}, selector, property, minLength); return this.getProperty(selector, property); }, diff --git a/e2e/helpers/puppeteer.js b/e2e/helpers/puppeteer.js index f562cf588..dace276be 100644 --- a/e2e/helpers/puppeteer.js +++ b/e2e/helpers/puppeteer.js @@ -48,12 +48,6 @@ export async function getBrowser() { }); page = extendPage(page); page.setDefaultTimeout(5000); - await page.addStyleTag({ - content: `* { - transition: none!important; - animation: none!important; - }` - }); await page.goto(defaultURL, {waitUntil: 'load'}); return {page, close: browser.close.bind(browser)}; diff --git a/front/salix/components/home/home.js b/front/salix/components/home/home.js index 74b43a12f..7a36e1d42 100644 --- a/front/salix/components/home/home.js +++ b/front/salix/components/home/home.js @@ -34,8 +34,10 @@ export default class Controller extends Component { for (let starredModule of res.data) { const module = this.modules.find(mod => mod.name === starredModule.moduleFk); - module.starred = true; - module.position = starredModule.position; + if (module) { + module.starred = true; + module.position = starredModule.position; + } } this.countModules(); });