npm eslint --fix .
This commit is contained in:
parent
6bea363b9d
commit
2c2b84d31d
56 changed files with 294 additions and 295 deletions
|
@ -37,4 +37,4 @@ describe('DateUtils', () => {
|
|||
expect(DateUtils.relativeTimeShort(time)).to.eql({ num: 2, key: 'time.years_short' })
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -206,15 +206,15 @@ describe('API Entities normalizer', () => {
|
|||
})
|
||||
|
||||
it('sets nsfw for statuses with the #nsfw tag', () => {
|
||||
const safe = makeMockStatusQvitter({id: '1', text: 'Hello oniichan'})
|
||||
const nsfw = makeMockStatusQvitter({id: '1', text: 'Hello oniichan #nsfw'})
|
||||
const safe = makeMockStatusQvitter({ id: '1', text: 'Hello oniichan' })
|
||||
const nsfw = makeMockStatusQvitter({ id: '1', text: 'Hello oniichan #nsfw' })
|
||||
|
||||
expect(parseStatus(safe).nsfw).to.eq(false)
|
||||
expect(parseStatus(nsfw).nsfw).to.eq(true)
|
||||
})
|
||||
|
||||
it('leaves existing nsfw settings alone', () => {
|
||||
const nsfw = makeMockStatusQvitter({id: '1', text: 'Hello oniichan #nsfw', nsfw: false})
|
||||
const nsfw = makeMockStatusQvitter({ id: '1', text: 'Hello oniichan #nsfw', nsfw: false })
|
||||
|
||||
expect(parseStatus(nsfw).nsfw).to.eq(false)
|
||||
})
|
||||
|
@ -323,9 +323,9 @@ describe('API Entities normalizer', () => {
|
|||
describe('MastoAPI emoji adder', () => {
|
||||
const emojis = makeMockEmojiMasto()
|
||||
const imageHtml = '<img src="https://example.com/image.png" alt="image" title="image" class="emoji" />'
|
||||
.replace(/"/g, '\'')
|
||||
.replace(/"/g, '\'')
|
||||
const thinkHtml = '<img src="https://example.com/think.png" alt="thinking" title="thinking" class="emoji" />'
|
||||
.replace(/"/g, '\'')
|
||||
.replace(/"/g, '\'')
|
||||
|
||||
it('correctly replaces shortcodes in supplied string', () => {
|
||||
const result = addEmojis('This post has :image: emoji and :thinking: emoji', emojis)
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
import fileSizeFormatService from '../../../../../src/services/file_size_format/file_size_format.js'
|
||||
describe('fileSizeFormat', () => {
|
||||
it('Formats file size', () => {
|
||||
const values = [1, 1024, 1048576, 1073741824, 1099511627776]
|
||||
const expected = [
|
||||
{
|
||||
num: 1,
|
||||
unit: 'B'
|
||||
},
|
||||
{
|
||||
num: 1,
|
||||
unit: 'KiB'
|
||||
},
|
||||
{
|
||||
num: 1,
|
||||
unit: 'MiB'
|
||||
},
|
||||
{
|
||||
num: 1,
|
||||
unit: 'GiB'
|
||||
},
|
||||
{
|
||||
num: 1,
|
||||
unit: 'TiB'
|
||||
}
|
||||
]
|
||||
import fileSizeFormatService from '../../../../../src/services/file_size_format/file_size_format.js'
|
||||
describe('fileSizeFormat', () => {
|
||||
it('Formats file size', () => {
|
||||
const values = [1, 1024, 1048576, 1073741824, 1099511627776]
|
||||
const expected = [
|
||||
{
|
||||
num: 1,
|
||||
unit: 'B'
|
||||
},
|
||||
{
|
||||
num: 1,
|
||||
unit: 'KiB'
|
||||
},
|
||||
{
|
||||
num: 1,
|
||||
unit: 'MiB'
|
||||
},
|
||||
{
|
||||
num: 1,
|
||||
unit: 'GiB'
|
||||
},
|
||||
{
|
||||
num: 1,
|
||||
unit: 'TiB'
|
||||
}
|
||||
]
|
||||
|
||||
var res = []
|
||||
for (var value in values) {
|
||||
res.push(fileSizeFormatService.fileSizeFormat(values[value]))
|
||||
}
|
||||
expect(res).to.eql(expected)
|
||||
})
|
||||
})
|
||||
var res = []
|
||||
for (var value in values) {
|
||||
res.push(fileSizeFormatService.fileSizeFormat(values[value]))
|
||||
}
|
||||
expect(res).to.eql(expected)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const example = '<div class="status-content">@<a href="https://sealion.club/user/4" class="h-card mention" title="dewoo">dwmatiz</a> <a href="https://social.heldscal.la/file/3deb764ada10ce64a61b7a070b75dac45f86d2d5bf213bf18873da71d8714d86.png" title="https://social.heldscal.la/file/3deb764ada10ce64a61b7a070b75dac45f86d2d5bf213bf18873da71d8714d86.png" class="attachment" id="attachment-159853" rel="nofollow external">https://social.heldscal.la/attachment/159853</a></div>'
|
||||
|
||||
import { removeAttachmentLinks } from '../../../../../src/services/status_parser/status_parser.js'
|
||||
|
||||
const example = '<div class="status-content">@<a href="https://sealion.club/user/4" class="h-card mention" title="dewoo">dwmatiz</a> <a href="https://social.heldscal.la/file/3deb764ada10ce64a61b7a070b75dac45f86d2d5bf213bf18873da71d8714d86.png" title="https://social.heldscal.la/file/3deb764ada10ce64a61b7a070b75dac45f86d2d5bf213bf18873da71d8714d86.png" class="attachment" id="attachment-159853" rel="nofollow external">https://social.heldscal.la/attachment/159853</a></div>'
|
||||
|
||||
describe('statusParser.removeAttachmentLinks', () => {
|
||||
const exampleWithoutAttachmentLinks = '<div class="status-content">@<a href="https://sealion.club/user/4" class="h-card mention" title="dewoo">dwmatiz</a> </div>'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue