Skip to content

Add a test with more tags for notes:withTags: #63

@Ducasse

Description

@Ducasse

Point 1 More tests

testNotesWithTags

	| result |
	ressources addingNotesAndTagsTo: noteTakerContainer.

	result := noteTakerContainer
		          notes: noteTakerContainer notes
		          withTags: (OrderedCollection new
				           add: (noteTakerContainer ensureTagNamed: 'test');
				           yourself).
	self assert: result size equals: 0.

	result := noteTakerContainer
		          notes: noteTakerContainer notes
		          withTags: (OrderedCollection new
				           add: ressources getTag1;
				           yourself).
	self assert: result size equals: 1

Point 2: rename method

In addition notes:withTags: could be interpreted as a setter
-> rename it for example selectNotes:withTags:

Point 3: is argument really needed?

Question why the container is needed to get a collection of notes? Why does not work on its notes.
Why the method is not just selectWithTags:?

Ok the answer is probably here

filter

	| filteredItems |
	filteredItems := searchBar text
		                 ifEmpty: [ self notes ]
		                 ifNotEmpty: [ :pattern |
		                 self model notesContentsMatching: pattern ].

	filteredItems := filteredTagsSelection
		                 ifEmpty: [ filteredItems ]
		                 ifNotEmpty: [ :pattern |
			                 self model
				                 notes: filteredItems
				                 withTags: filteredTagsSelection ].

	self items: filteredItems

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions