kopia lustrzana https://github.com/wagtail/wagtail
JS linting fixes
rodzic
532a530836
commit
f115ff7f4d
|
|
@ -8,7 +8,7 @@ describe('Document', () => {
|
||||||
it('works', () => {
|
it('works', () => {
|
||||||
const content = convertFromRaw({
|
const content = convertFromRaw({
|
||||||
entityMap: {
|
entityMap: {
|
||||||
'1': {
|
1: {
|
||||||
type: 'DOCUMENT',
|
type: 'DOCUMENT',
|
||||||
data: {
|
data: {
|
||||||
url: '/example.pdf',
|
url: '/example.pdf',
|
||||||
|
|
@ -29,7 +29,7 @@ describe('Document', () => {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
});
|
||||||
expect(shallow((
|
expect(shallow((
|
||||||
<Document
|
<Document
|
||||||
contentState={content}
|
contentState={content}
|
||||||
|
|
@ -45,7 +45,7 @@ describe('Document', () => {
|
||||||
it('no data', () => {
|
it('no data', () => {
|
||||||
const content = convertFromRaw({
|
const content = convertFromRaw({
|
||||||
entityMap: {
|
entityMap: {
|
||||||
'2': {
|
2: {
|
||||||
type: 'DOCUMENT',
|
type: 'DOCUMENT',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -62,7 +62,7 @@ describe('Document', () => {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
});
|
||||||
expect(shallow((
|
expect(shallow((
|
||||||
<Document
|
<Document
|
||||||
contentState={content}
|
contentState={content}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ describe('Link', () => {
|
||||||
it('works', () => {
|
it('works', () => {
|
||||||
const content = convertFromRaw({
|
const content = convertFromRaw({
|
||||||
entityMap: {
|
entityMap: {
|
||||||
'1': {
|
1: {
|
||||||
type: 'LINK',
|
type: 'LINK',
|
||||||
data: {
|
data: {
|
||||||
url: 'http://www.example.com/',
|
url: 'http://www.example.com/',
|
||||||
|
|
@ -28,7 +28,7 @@ describe('Link', () => {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
});
|
||||||
expect(shallow((
|
expect(shallow((
|
||||||
<Link
|
<Link
|
||||||
contentState={content}
|
contentState={content}
|
||||||
|
|
@ -46,25 +46,25 @@ describe('Link', () => {
|
||||||
expect(getLinkAttributes({ id: '1', url: '/' })).toMatchObject({
|
expect(getLinkAttributes({ id: '1', url: '/' })).toMatchObject({
|
||||||
url: '/',
|
url: '/',
|
||||||
label: '/',
|
label: '/',
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('mail', () => {
|
it('mail', () => {
|
||||||
expect(getLinkAttributes({ url: 'mailto:test@ex.com' })).toMatchObject({
|
expect(getLinkAttributes({ url: 'mailto:test@ex.com' })).toMatchObject({
|
||||||
url: 'mailto:test@ex.com',
|
url: 'mailto:test@ex.com',
|
||||||
label: 'test@ex.com',
|
label: 'test@ex.com',
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('external', () => {
|
it('external', () => {
|
||||||
expect(getLinkAttributes({ url: 'http://www.ex.com/' })).toMatchObject({
|
expect(getLinkAttributes({ url: 'http://www.ex.com/' })).toMatchObject({
|
||||||
url: 'http://www.ex.com/',
|
url: 'http://www.ex.com/',
|
||||||
label: 'www.ex.com',
|
label: 'www.ex.com',
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('no data', () => {
|
it('no data', () => {
|
||||||
expect(getLinkAttributes({})).toMatchObject({ url: '' })
|
expect(getLinkAttributes({})).toMatchObject({ url: '' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -53,14 +53,18 @@ module.exports = function exports() {
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
},
|
},
|
||||||
].concat(Object.keys(exposedDependencies).map((name) => {
|
].concat(Object.keys(exposedDependencies).map((name) => {
|
||||||
|
const globalName = exposedDependencies[name];
|
||||||
|
|
||||||
// Create expose-loader configs for each Wagtail dependency.
|
// Create expose-loader configs for each Wagtail dependency.
|
||||||
return {
|
return {
|
||||||
test: require.resolve(name),
|
test: require.resolve(name),
|
||||||
use: [{
|
use: [
|
||||||
|
{
|
||||||
loader: 'expose-loader',
|
loader: 'expose-loader',
|
||||||
options: exposedDependencies[name]
|
options: globalName,
|
||||||
}]
|
},
|
||||||
}
|
],
|
||||||
|
};
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
stats: {
|
stats: {
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue