fix highlight test

This commit is contained in:
Henry Jameson 2026-03-31 17:44:34 +03:00
commit be82385d79

View file

@ -174,13 +174,11 @@ describe('The UserHighlight store', () => {
it('should prefer recent and apply journal to it', () => { it('should prefer recent and apply journal to it', () => {
expect( expect(
_mergeHighlights( _mergeHighlights(
// RECENT
{ {
highlight: { // RECENT
'a@test.xyz': 1, 'a@test.xyz': 1,
'b@test.xyz': 0, 'b@test.xyz': 0,
'c@test.xyz': true, 'c@test.xyz': true,
},
_journal: [ _journal: [
{ {
user: 'b@test.xyz', user: 'b@test.xyz',
@ -196,13 +194,11 @@ describe('The UserHighlight store', () => {
}, },
], ],
}, },
// STALE
{ {
highlight: { // STALE
'a@test.xyz': 1, 'a@test.xyz': 1,
'b@test.xyz': 1, 'b@test.xyz': 1,
'c@test.xyz': false, 'c@test.xyz': false,
},
_journal: [ _journal: [
{ {
user: 'a@test.xyz', user: 'a@test.xyz',
@ -220,7 +216,9 @@ describe('The UserHighlight store', () => {
}, },
), ),
).to.eql({ ).to.eql({
highlight: { 'a@test.xyz': 1, 'b@test.xyz': 1, 'c@test.xyz': true }, 'a@test.xyz': 1,
'b@test.xyz': 1,
'c@test.xyz': true,
_journal: [ _journal: [
{ user: 'a@test.xyz', operation: 'set', args: [1], timestamp: 1 }, { user: 'a@test.xyz', operation: 'set', args: [1], timestamp: 1 },
{ user: 'b@test.xyz', operation: 'set', args: [1], timestamp: 3 }, { user: 'b@test.xyz', operation: 'set', args: [1], timestamp: 3 },
@ -239,7 +237,7 @@ describe('The UserHighlight store', () => {
_mergeHighlights( _mergeHighlights(
// RECENT // RECENT
{ {
highlight: { 'a@test.xyz': { type: 'foo' } }, 'a@test.xyz': { type: 'foo' },
_journal: [ _journal: [
{ {
user: 'a@test.xyz', user: 'a@test.xyz',
@ -251,7 +249,7 @@ describe('The UserHighlight store', () => {
}, },
// STALE // STALE
{ {
highlight: { 'a@test.xyz': { type: 'bar' } }, 'a@test.xyz': { type: 'bar' },
_journal: [ _journal: [
{ {
user: 'a@test.xyz', user: 'a@test.xyz',
@ -263,7 +261,7 @@ describe('The UserHighlight store', () => {
}, },
), ),
).to.eql({ ).to.eql({
highlight: { 'a@test.xyz': { type: 'bar' } }, 'a@test.xyz': { type: 'bar' },
_journal: [ _journal: [
{ {
user: 'a@test.xyz', user: 'a@test.xyz',
@ -280,7 +278,7 @@ describe('The UserHighlight store', () => {
_mergeHighlights( _mergeHighlights(
// RECENT // RECENT
{ {
highlight: { 'a@test.xyz': { type: 'foo' } }, 'a@test.xyz': { type: 'foo' },
_journal: [ _journal: [
{ {
user: 'a@test.xyz', user: 'a@test.xyz',
@ -292,7 +290,6 @@ describe('The UserHighlight store', () => {
}, },
// STALE // STALE
{ {
highlight: {},
_journal: [ _journal: [
{ {
user: 'a@test.xyz', user: 'a@test.xyz',
@ -304,7 +301,6 @@ describe('The UserHighlight store', () => {
}, },
), ),
).to.eql({ ).to.eql({
highlight: {},
_journal: [ _journal: [
{ {
user: 'a@test.xyz', user: 'a@test.xyz',