mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 15:49:50 +00:00
Fix tests
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
21e18660eb
commit
3468cbfa35
@ -82,8 +82,8 @@ describe('Admin | components | AuthenticatedApp', () => {
|
|||||||
border: 6px solid #f3f3f3;
|
border: 6px solid #f3f3f3;
|
||||||
border-top: 6px solid #1c91e7;
|
border-top: 6px solid #1c91e7;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
-webkit-animation: fEWCgj 2s linear infinite;
|
-webkit-animation: cilQsd 2s linear infinite;
|
||||||
animation: fEWCgj 2s linear infinite;
|
animation: cilQsd 2s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -294,8 +294,8 @@ describe('Content manager | App | main', () => {
|
|||||||
border: 6px solid #f3f3f3;
|
border: 6px solid #f3f3f3;
|
||||||
border-top: 6px solid #1c91e7;
|
border-top: 6px solid #1c91e7;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
-webkit-animation: fEWCgj 2s linear infinite;
|
-webkit-animation: cilQsd 2s linear infinite;
|
||||||
animation: fEWCgj 2s linear infinite;
|
animation: cilQsd 2s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
.c0 {
|
.c0 {
|
||||||
|
|||||||
@ -37,8 +37,8 @@ describe('ADMIN | StrapiApp', () => {
|
|||||||
border: 6px solid #f3f3f3;
|
border: 6px solid #f3f3f3;
|
||||||
border-top: 6px solid #1c91e7;
|
border-top: 6px solid #1c91e7;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
-webkit-animation: fEWCgj 2s linear infinite;
|
-webkit-animation: cilQsd 2s linear infinite;
|
||||||
animation: fEWCgj 2s linear infinite;
|
animation: cilQsd 2s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|||||||
18
packages/core/helper-plugin/babel.config.js
Normal file
18
packages/core/helper-plugin/babel.config.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
const defaultPresets = [
|
||||||
|
[
|
||||||
|
'@babel/preset-env',
|
||||||
|
{
|
||||||
|
modules: 'commonjs',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
presets: defaultPresets.concat(['@babel/preset-react', '@babel/preset-flow']),
|
||||||
|
plugins: [
|
||||||
|
'@babel/plugin-proposal-class-properties',
|
||||||
|
'@babel/plugin-proposal-export-default-from',
|
||||||
|
'@babel/plugin-proposal-export-namespace-from',
|
||||||
|
'@babel/plugin-proposal-function-bind',
|
||||||
|
],
|
||||||
|
};
|
||||||
@ -2,8 +2,8 @@
|
|||||||
"name": "@strapi/helper-plugin",
|
"name": "@strapi/helper-plugin",
|
||||||
"version": "3.6.6",
|
"version": "3.6.6",
|
||||||
"description": "Helper for Strapi plugins development",
|
"description": "Helper for Strapi plugins development",
|
||||||
"main": "build/index.js",
|
"main": "build/helper-plugin.js",
|
||||||
"module": "build/index.esm.js",
|
"module": "lib/src/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
"build"
|
"build"
|
||||||
],
|
],
|
||||||
@ -27,8 +27,10 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"prebuild": "rimraf build",
|
"prebuild": "rimraf build",
|
||||||
"build": "rollup -c",
|
"build": "webpack-cli",
|
||||||
"watch": "rollup -c -w",
|
"build:rollup": "rollup -c",
|
||||||
|
"watch": "webpack-cli -w",
|
||||||
|
"watch:rollup": "rollup -c -w",
|
||||||
"test": "echo \"no tests yet\"",
|
"test": "echo \"no tests yet\"",
|
||||||
"storybook": "start-storybook -p 6006",
|
"storybook": "start-storybook -p 6006",
|
||||||
"build-storybook": "build-storybook"
|
"build-storybook": "build-storybook"
|
||||||
@ -41,6 +43,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.14.0",
|
"@babel/core": "7.14.0",
|
||||||
"@babel/plugin-proposal-class-properties": "7.13.0",
|
"@babel/plugin-proposal-class-properties": "7.13.0",
|
||||||
|
"@babel/plugin-proposal-export-default-from": "7.14.5",
|
||||||
|
"@babel/plugin-proposal-function-bind": "7.14.5",
|
||||||
"@babel/plugin-transform-runtime": "7.13.15",
|
"@babel/plugin-transform-runtime": "7.13.15",
|
||||||
"@babel/preset-env": "7.14.0",
|
"@babel/preset-env": "7.14.0",
|
||||||
"@babel/preset-react": "7.13.13",
|
"@babel/preset-react": "7.13.13",
|
||||||
@ -80,6 +84,8 @@
|
|||||||
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||||
"@fortawesome/react-fontawesome": "^0.1.14",
|
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||||
"@rollup/plugin-image": "2.0.6",
|
"@rollup/plugin-image": "2.0.6",
|
||||||
|
"@strapi/icons": "0.0.1-alpha.15",
|
||||||
|
"@strapi/parts": "0.0.1-alpha.15",
|
||||||
"axios": "0.21.1",
|
"axios": "0.21.1",
|
||||||
"babel-plugin-styled-components": "1.12.0",
|
"babel-plugin-styled-components": "1.12.0",
|
||||||
"classnames": "^2.3.1",
|
"classnames": "^2.3.1",
|
||||||
@ -87,6 +93,7 @@
|
|||||||
"immutable": "^3.8.2",
|
"immutable": "^3.8.2",
|
||||||
"invariant": "^2.2.1",
|
"invariant": "^2.2.1",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
|
"match-sorter": "^4.0.2",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
|
|||||||
65
packages/core/helper-plugin/webpack.config.js
Normal file
65
packages/core/helper-plugin/webpack.config.js
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
const webpack = require('webpack');
|
||||||
|
const path = require('path');
|
||||||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
const packageJson = require('./package.json');
|
||||||
|
|
||||||
|
const nodeModules = [];
|
||||||
|
[
|
||||||
|
...Object.keys(packageJson.dependencies),
|
||||||
|
...Object.keys(packageJson.peerDependencies),
|
||||||
|
...Object.keys(packageJson.devDependencies),
|
||||||
|
].forEach(module => {
|
||||||
|
nodeModules.push(new RegExp(`^${module}(/.+)?$`));
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: `${__dirname}/lib/src/index.js`,
|
||||||
|
externals: nodeModules,
|
||||||
|
// mode: process.env.NODE_ENV,
|
||||||
|
mode: 'production',
|
||||||
|
devtool: 'source-map',
|
||||||
|
output: {
|
||||||
|
path: `${__dirname}/build`,
|
||||||
|
filename: `helper-plugin.js`,
|
||||||
|
library: {
|
||||||
|
name: 'helperPlugin',
|
||||||
|
type: 'umd',
|
||||||
|
},
|
||||||
|
|
||||||
|
umdNamedDefine: true,
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
include: path.resolve(__dirname, 'lib', 'src'),
|
||||||
|
loader: 'babel-loader',
|
||||||
|
exclude: /(node_modules)/,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: ['style-loader', 'css-loader'],
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
test: /\.(png|svg|jpg|gif)$/,
|
||||||
|
loader: 'url-loader',
|
||||||
|
options: {
|
||||||
|
limit: 8192,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['*', '.js'],
|
||||||
|
cacheWithContext: false,
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.EnvironmentPlugin({
|
||||||
|
NODE_ENV: 'production',
|
||||||
|
}),
|
||||||
|
new MiniCssExtractPlugin({
|
||||||
|
filename: 'style.css',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
};
|
||||||
@ -6,7 +6,7 @@ const addColumnToTableHook = ({ displayedHeaders, layout }) => {
|
|||||||
const isFieldLocalized = get(layout, 'contentType.pluginOptions.i18n.localized', false);
|
const isFieldLocalized = get(layout, 'contentType.pluginOptions.i18n.localized', false);
|
||||||
|
|
||||||
if (!isFieldLocalized) {
|
if (!isFieldLocalized) {
|
||||||
return displayedHeaders;
|
return { displayedHeaders, layout };
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -9,8 +9,10 @@ describe('i18n | contentManagerHooks | addColumnToTable', () => {
|
|||||||
|
|
||||||
const result = addColumnToTable({ displayedHeaders, layout });
|
const result = addColumnToTable({ displayedHeaders, layout });
|
||||||
|
|
||||||
expect(result).toHaveLength(1);
|
expect(result).toHaveProperty('displayedHeaders');
|
||||||
expect(result).toEqual(['one']);
|
expect(result).toHaveProperty('layout');
|
||||||
|
expect(result.displayedHeaders).toHaveLength(1);
|
||||||
|
expect(result.displayedHeaders).toEqual(['one']);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds a header to the displayedHeaders array when the content type is localized', () => {
|
it('adds a header to the displayedHeaders array when the content type is localized', () => {
|
||||||
|
|||||||
@ -54,8 +54,8 @@ describe('Admin | containers | ProvidersPage', () => {
|
|||||||
border: 6px solid #f3f3f3;
|
border: 6px solid #f3f3f3;
|
||||||
border-top: 6px solid #1c91e7;
|
border-top: 6px solid #1c91e7;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
-webkit-animation: fEWCgj 2s linear infinite;
|
-webkit-animation: cilQsd 2s linear infinite;
|
||||||
animation: fEWCgj 2s linear infinite;
|
animation: cilQsd 2s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
.c1 {
|
.c1 {
|
||||||
|
|||||||
17
yarn.lock
17
yarn.lock
@ -608,7 +608,7 @@
|
|||||||
"@babel/helper-plugin-utils" "^7.14.5"
|
"@babel/helper-plugin-utils" "^7.14.5"
|
||||||
"@babel/plugin-syntax-dynamic-import" "^7.8.3"
|
"@babel/plugin-syntax-dynamic-import" "^7.8.3"
|
||||||
|
|
||||||
"@babel/plugin-proposal-export-default-from@^7.12.1":
|
"@babel/plugin-proposal-export-default-from@7.14.5", "@babel/plugin-proposal-export-default-from@^7.12.1":
|
||||||
version "7.14.5"
|
version "7.14.5"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.14.5.tgz#8931a6560632c650f92a8e5948f6e73019d6d321"
|
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.14.5.tgz#8931a6560632c650f92a8e5948f6e73019d6d321"
|
||||||
integrity sha512-T8KZ5abXvKMjF6JcoXjgac3ElmXf0AWzJwi2O/42Jk+HmCky3D9+i1B7NPP1FblyceqTevKeV/9szeikFoaMDg==
|
integrity sha512-T8KZ5abXvKMjF6JcoXjgac3ElmXf0AWzJwi2O/42Jk+HmCky3D9+i1B7NPP1FblyceqTevKeV/9szeikFoaMDg==
|
||||||
@ -624,6 +624,14 @@
|
|||||||
"@babel/helper-plugin-utils" "^7.14.5"
|
"@babel/helper-plugin-utils" "^7.14.5"
|
||||||
"@babel/plugin-syntax-export-namespace-from" "^7.8.3"
|
"@babel/plugin-syntax-export-namespace-from" "^7.8.3"
|
||||||
|
|
||||||
|
"@babel/plugin-proposal-function-bind@7.14.5":
|
||||||
|
version "7.14.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-bind/-/plugin-proposal-function-bind-7.14.5.tgz#83bbc684312bf82bda46ec7cb52dc226e891833f"
|
||||||
|
integrity sha512-PSQk5JImi81nFAzIebCEqkd0aiP9LDVKLCIH+0yR66JV8cQ1oZ8IRK9NNaA5nw9sjo0cPXxuBPCqgqcpugR8tA==
|
||||||
|
dependencies:
|
||||||
|
"@babel/helper-plugin-utils" "^7.14.5"
|
||||||
|
"@babel/plugin-syntax-function-bind" "^7.14.5"
|
||||||
|
|
||||||
"@babel/plugin-proposal-json-strings@^7.13.8", "@babel/plugin-proposal-json-strings@^7.14.5":
|
"@babel/plugin-proposal-json-strings@^7.13.8", "@babel/plugin-proposal-json-strings@^7.14.5":
|
||||||
version "7.14.5"
|
version "7.14.5"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb"
|
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb"
|
||||||
@ -782,6 +790,13 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@babel/helper-plugin-utils" "^7.14.5"
|
"@babel/helper-plugin-utils" "^7.14.5"
|
||||||
|
|
||||||
|
"@babel/plugin-syntax-function-bind@^7.14.5":
|
||||||
|
version "7.14.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-function-bind/-/plugin-syntax-function-bind-7.14.5.tgz#eb7544014fe349f48acbebc5084eeadde2efe57e"
|
||||||
|
integrity sha512-gstAIrKtlPwrQaRz4uK+kT7zI2p5MQqX41SeO+kZKH1XGO1jL0nLZBWznRigPpkem6LfIoG2EduQZmPBcUwEmg==
|
||||||
|
dependencies:
|
||||||
|
"@babel/helper-plugin-utils" "^7.14.5"
|
||||||
|
|
||||||
"@babel/plugin-syntax-import-meta@^7.8.3":
|
"@babel/plugin-syntax-import-meta@^7.8.3":
|
||||||
version "7.10.4"
|
version "7.10.4"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51"
|
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user