-
Notifications
You must be signed in to change notification settings - Fork 25
Fixed issue where item wasn't moved to new section. #81
base: master
Are you sure you want to change the base?
Conversation
If the section didn't exist before the item was moved the updated item would be inserted instead of moved causing the new section to not be displayed properly in the tableView.
type = cache.updateType(task) | ||
} | ||
it("returns type .Move") { | ||
expect(type) == RealmCacheUpdateType.Move |
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 think in this case the desired test to have is if a nonResolvedTask resolved
flag changes to true
, it should return a .Move
. In this concrete case it should return a deletion, as the predicate of the request
is saying that it only "allows" tasks that have resolved == true
, and this is not the case
Thanks for the PR @jallen 😄 |
Use array filter instead of predicate to limit initial set of tasks to be contained in one section using "resolved" sectionKeyPath.
I see where my test went wrong. I'm now just filtering the initial set of objects. Also, maybe an initResolvedWithKeyPath method would be cleaner? Let me know what you think. |
This reverts commit 9a6156d.
If the section didn't exist before the item was moved the updated item would be inserted instead of moved causing the new section to not be displayed properly in the tableView.
Use array filter instead of predicate to limit initial set of tasks to be contained in one section using "resolved" sectionKeyPath.
…Controller into bug/new-section-move # Conflicts: # Example/RealmResultsController-iOSTests/RealmResultsCacheTests.swift # Source/RealmResultsCache.swift
🎩 What? Why?
If an item is moved to a new section and the section doesn't exist the item is Inserted instead of moved causing the section in the tableView to not be displayed.
👪 Dependencies?
📋 Developer checklist
👻 GIF
If the section didn't exist before the item was moved the updated item would be inserted instead of moved causing the new section to not be displayed properly in the tableView.