more low-hanging fruits

This commit is contained in:
Henry Jameson 2026-08-04 17:12:46 +03:00
commit b2dca4a3f6
20 changed files with 45 additions and 45 deletions

View file

@ -50,7 +50,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(html))
expect(wrapper.html().replaceAll('\n', '')).to.eql(compwrap(html))
})
it('unescapes everything as needed', () => {
@ -67,7 +67,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected))
expect(wrapper.html().replaceAll('\n', '')).to.eql(compwrap(expected))
})
it('replaces mention with mentionsline', () => {
@ -83,7 +83,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(
expect(wrapper.html().replaceAll('\n', '')).to.eql(
compwrap(p(mentionsLine(1), ' how are you doing today?')),
)
})
@ -116,7 +116,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected))
expect(wrapper.html().replaceAll('\n', '')).to.eql(compwrap(expected))
})
it('Does not touch links if link handling is disabled', () => {
@ -211,7 +211,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected))
expect(wrapper.html().replaceAll('\n', '')).to.eql(compwrap(expected))
})
it("Doesn't add nonexistent emoji to post", () => {
@ -228,7 +228,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(html))
expect(wrapper.html().replaceAll('\n', '')).to.eql(compwrap(html))
})
it('Greentext + last mentions', () => {
@ -279,7 +279,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected))
expect(wrapper.html().replaceAll('\n', '')).to.eql(compwrap(expected))
})
it('buggy example/hashtags', () => {
@ -315,7 +315,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected))
expect(wrapper.html().replaceAll('\n', '')).to.eql(compwrap(expected))
})
it('rich contents of a mention are handled properly', () => {
@ -365,8 +365,8 @@ describe('RichContent', () => {
expect(
wrapper
.html()
.replace(/\n/g, '')
.replace(/<!--.*?-->/g, ''),
.replaceAll('\n', '')
.replaceAll('<!--.*?-->', ''),
).to.eql(compwrap(expected))
})
@ -438,8 +438,8 @@ describe('RichContent', () => {
expect(
wrapper
.html()
.replace(/\n/g, '')
.replace(/<!--.*?-->/g, ''),
.replaceAll('\n', '')
.replaceAll('<!--.*?-->', ''),
).to.eql(compwrap(expected))
})
@ -484,7 +484,7 @@ describe('RichContent', () => {
},
})
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected))
expect(wrapper.html().replaceAll('\n', '')).to.eql(compwrap(expected))
})
it.skip('[INFORMATIVE] Performance testing, 10 000 simple posts', () => {

View file

@ -107,7 +107,7 @@ describe('Statuses module', () => {
showImmediately: true,
timeline: 'public',
})
expect(state.timelines.public.maxId).to.eql('1')
expect(state.timelines.public.maxId).to.equal('1')
mutations.addNewStatuses(state, {
statuses: [secondStatus],
@ -120,7 +120,7 @@ describe('Statuses module', () => {
secondStatus,
status,
])
expect(state.timelines.public.maxId).to.eql('1')
expect(state.timelines.public.maxId).to.equal('1')
})
it('keeps a descending by id order in timeline.visibleStatuses and timeline.statuses', () => {
@ -340,7 +340,7 @@ describe('Statuses module', () => {
expect(state.allStatusesObject['1'].emoji_reactions[0].me).to.eql(true)
expect(
state.allStatusesObject['1'].emoji_reactions[0].accounts[0].id,
).to.eql('me')
).to.equal('me')
})
it('adds a new reaction', () => {
@ -362,7 +362,7 @@ describe('Statuses module', () => {
expect(state.allStatusesObject['1'].emoji_reactions[0].me).to.eql(true)
expect(
state.allStatusesObject['1'].emoji_reactions[0].accounts[0].id,
).to.eql('me')
).to.equal('me')
})
it('decreases count in existing reaction', () => {
@ -429,8 +429,8 @@ describe('Statuses module', () => {
mutations.showNewStatuses(state, { timeline: 'public' })
expect(state.timelines.public.visibleStatuses.length).to.eql(2)
expect(state.timelines.public.minVisibleId).to.eql('10')
expect(state.timelines.public.minId).to.eql('10')
expect(state.timelines.public.minVisibleId).to.equal('10')
expect(state.timelines.public.minId).to.equal('10')
})
})