Skip to content

Commit

Permalink
Merge branch 'main' into 3881-document-luigi-element-feature-on-docu-…
Browse files Browse the repository at this point in the history
…website
  • Loading branch information
walmazacn authored Nov 7, 2024
2 parents 98118d4 + 3709fc6 commit 907fce6
Show file tree
Hide file tree
Showing 27 changed files with 7,043 additions and 6,838 deletions.
9 changes: 0 additions & 9 deletions .eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions code_quality.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ const fullEslint = async (filesByExtension) => {
console.log('Wrote eslint report to file ' + path.resolve(reportFile));
}
console.log(
"Eslint executed in ' + esLintResult.numberFiles + ' files. Results written in 'full_eslint_report.html' "
'Eslint executed in ' + esLintResult.numberFiles + ' files. Results written in "full_eslint_report.html"'
);
};

Expand Down Expand Up @@ -376,7 +376,7 @@ const getOptions = () => {
}

console.error(
'You need to pass application parameter -- mode=pre_commit|pre_commit-prettier|pre_commit-eslint|full|full-prettier|full-eslint'
'You need to pass application parameter -- mode=pre_commit|pre_commit_prettier|pre_commit_eslint|full|full-prettier|full-eslint'
);
})().catch((err) => {
console.log(err);
Expand Down
51 changes: 0 additions & 51 deletions container/.eslintrc.cjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,40 @@ describe('Compound Container Tests', () => {
});
});

it('openAsModal webcomponent container', () => {
cy.on('window:alert', stub);

cy.get(containerSelector)
.shadow()
.get('#openAsModalBtn')
.click()
.then(() => {
cy.hash().should('eq', '#openAsModal-wc');
});
});
it('openAsDrawer webcomponent container', () => {
cy.on('window:alert', stub);

cy.get(containerSelector)
.shadow()
.get('#openAsDrawerBtn')
.click()
.then(() => {
cy.hash().should('eq', '#openAsDrawer-wc');
});
});
it('openAsSplitview webcomponent container', () => {
cy.on('window:alert', stub);

cy.get(containerSelector)
.shadow()
.get('#openAsSplitviewBtn')
.click()
.then(() => {
cy.hash().should('eq', '#openAsSplitview-wc');
});
});

it('LuigiClient API publishEvent', () => {
cy.on('window:alert', stub);

Expand Down
54 changes: 54 additions & 0 deletions container/cypress/e2e/test-app/iframe/iframe-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,58 @@ describe('Iframe Container Test', () => {
});
});
});

it('openAsModal', () => {
cy.on('window:confirm', () => false);

cy.get(containerSelector)
.shadow()
.get('iframe')
.then(iframe => {
const $body = iframe.contents().find('body');
cy.wrap($body)
.contains('test openAsModal()')
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#openAsModal-iframe');
});
});
});

it('openAsDrawer', () => {
cy.on('window:confirm', () => false);

cy.get(containerSelector)
.shadow()
.get('iframe')
.then(iframe => {
const $body = iframe.contents().find('body');
cy.wrap($body)
.contains('test openAsDrawer')
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#openAsDrawer-iframe');
});
});
});

it('openAsSplitview', () => {
cy.on('window:confirm', () => false);

cy.get(containerSelector)
.shadow()
.get('iframe')
.then(iframe => {
const $body = iframe.contents().find('body');
cy.wrap($body)
.contains('test openAsSplitview')
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#openAsSplitview-iframe');
});
});
});
});
34 changes: 34 additions & 0 deletions container/cypress/e2e/test-app/wc/wc-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,40 @@ describe('Web Container Test', () => {
});
});

it('openAsModal webcomponent container', () => {
cy.on('window:alert', stub);

cy.get(containerSelector)
.shadow()
.get('#openAsModalBtn')
.click()
.then(() => {
cy.hash().should('eq', '#openAsModal-wc');
});
});
it('openAsDrawer webcomponent container', () => {
cy.on('window:alert', stub);

cy.get(containerSelector)
.shadow()
.get('#openAsDrawerBtn')
.click()
.then(() => {
cy.hash().should('eq', '#openAsDrawer-wc');
});
});
it('openAsSplitview webcomponent container', () => {
cy.on('window:alert', stub);

cy.get(containerSelector)
.shadow()
.get('#openAsSplitviewBtn')
.click()
.then(() => {
cy.hash().should('eq', '#openAsSplitview-wc');
});
});

it('pathExists', () => {
cy.on('window:alert', stub);

Expand Down
76 changes: 76 additions & 0 deletions container/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import path from 'path';
import { fileURLToPath } from 'url';
import tseslint from 'typescript-eslint';
import svelteParser from 'svelte-eslint-parser';
import eslint from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

/** @type {import('eslint').Linter.Config[]} */
export default [
eslint.configs.recommended,
stylistic.configs['recommended-flat'],
...tseslint.configs.recommended,
{
files: ['src/**/*.*'],
ignores: [
'node_modules',
'test-app',
'*.config.js',
'public/*.js',
'public/index.d.ts',
'coverage',
'cypress',
'*.md',
'*.mjs',
'*.map',
'*.json',
'.*.*'
],
plugins: {
'@stylistic': stylistic,
'@tsPlugin': tsPlugin
},
languageOptions: {
globals: {
globalThis: false
},
parser: tsParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
extraFileExtensions: ['.svelte']
}
},
rules: {
'camelcase': 'off',
'no-undef': 'off',
'@stylistic/brace-style': 'off',
'@stylistic/comma-dangle': 'off',
'@stylistic/member-delimiter-style': 'off',
'@stylistic/operator-linebreak': 'off',
'@stylistic/quotes': 'off',
'@stylistic/semi': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-object-type': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unused-vars': 'off'
}
},
{
files: ['src/**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tsParser
}
}
}
];
Loading

0 comments on commit 907fce6

Please sign in to comment.