fix highlight test
This commit is contained in:
parent
7995622423
commit
be82385d79
1 changed files with 15 additions and 19 deletions
|
|
@ -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',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue