mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-06 19:26:55 +08:00
lint(*): correct eslint errors, warnings still exist
There are warnings in `spellcheck-composer-extension.es6` for the `while (true)` loops.
This commit is contained in:
parent
af6f544cc9
commit
f13fc46611
2 changed files with 16 additions and 11 deletions
|
@ -182,11 +182,12 @@ export default class SpellcheckComposerExtension extends ComposerExtension {
|
|||
static finalizeSessionBeforeSending = ({session}) => {
|
||||
const body = session.draft().body;
|
||||
const clean = body.replace(/<\/?spelling[^>]*>/g, '');
|
||||
|
||||
if (body !== clean) {
|
||||
return session.changes.add({body: clean});
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import AutoloadImagesExtension from '../lib/autoload-images-extension';
|
||||
import AutoloadImagesStore from '../lib/autoload-images-store';
|
||||
|
||||
|
@ -10,6 +11,7 @@ describe("AutoloadImagesExtension", ()=> {
|
|||
fs.readdirSync(fixtures).forEach((filename) => {
|
||||
if (filename.endsWith('-in.html')) {
|
||||
const name = filename.replace('-in.html', '');
|
||||
|
||||
scenarios.push({
|
||||
name: name,
|
||||
in: fs.readFileSync(path.join(fixtures, filename)).toString(),
|
||||
|
@ -21,11 +23,13 @@ describe("AutoloadImagesExtension", ()=> {
|
|||
scenarios.forEach((scenario)=> {
|
||||
it(`should process ${scenario.name}`, () => {
|
||||
spyOn(AutoloadImagesStore, 'shouldBlockImagesIn').andReturn(true);
|
||||
message = {
|
||||
body: scenario.in
|
||||
|
||||
const message = {
|
||||
body: scenario.in,
|
||||
};
|
||||
AutoloadImagesExtension.formatMessageBody({message});
|
||||
expect(message.body == scenario.out).toBe(true);
|
||||
|
||||
expect(message.body === scenario.out).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue