-
Notifications
You must be signed in to change notification settings - Fork 974
Keep bookmarked entries on history #6211
Keep bookmarked entries on history #6211
Conversation
We should add this case into
|
Great fix, @cezaraugusto 😄 Only thing I can add is a +1 for @darkdh's comment for adding a test |
@cezaraugusto does this also fix #5413? |
@bsclifton not really, that one happens due to our site's counter. There's an inconsistency between the moment we add a bookmark, but fix is on the way (next). |
location: testUrl1, | ||
lastAccessedTime: 123, | ||
tags: [siteTags.BOOKMARK] | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you might forgot to call addSite
for this siteDetail and you may need to leverage previous processedSites
as first argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cezaraugusto the above mention by @darkdh is correct; we need to actually call addSite
(which then calls mergeSiteDetails
, where the change was made). When you call addSite
, you'll want to make a test case for each value. Where it returns:
- lastAccessedTime = newSiteDetail.get('lastAccessedTime')
- lastAccessedTime = oldSiteDetail.get('lastAccessedTime')
- lastAccessedTime = 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks, added one for oldSites and one for newSites. Case for lastAccessedTime = 0
was already covered by @darkdh, since it's the same case AFAIU, I left it as-is.
it('returns oldSiteDetail value for lastAccessedTime when newSite value is undefined', function () { | ||
const oldSiteDetail = Immutable.fromJS({ | ||
lastAccessedTime: 456, | ||
tags: [siteTags.BOOKMARK], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks good but I think we should remove oldSiteDetail's tags to make it closer to our use case "Bookmark a site after it is added to history"
lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 😄 Thanks for the tests!
Auditor: @bsclifton, @darkdh Fix #6160 Test plan: Automated tests must pass npm run test -- --grep="returns newSiteDetail value for lastAccessedTime when oldSite value is undefined" npm run test -- --grep="returns oldSiteDetail value for lastAccessedTime when newSite value is undefined"
CI had 2 errors; I re-ran both of those locally and they both passed. Merging 😄 |
git rebase -i
to squash commits (if needed).Auditor: @bsclifton, @darkdh
Fix #6160
Test plan:
Automated tests must pass
Manual tests:
about:history
and check entry is thereabout:history
about:history