Skip to content

[CLOSED] Unit Tests for Find, Replace, Find in Files, File Filters #6613

@core-ai-bot

Description

@core-ai-bot

Issue by redmunds
Tuesday Mar 25, 2014 at 20:50 GMT
Originally opened as adobe/brackets#7328


https://trello.com/c/qvHL6r4i/45-unit-tests-for-existing-find-replace-find-in-files-features


Find

  • Invoke Find with selection (make sure search text is selection)
    • added: "should get single selection as initial query"
  • Invoke Find without selection (make sure search text is empty)
    • added: "should use empty initial query for single cursor selection", and
    • added: "should use empty initial query for multiple cursor selection"
  • Invoke Find next while Find is open with no text
    • existing: "should no-op on Find Next with blank search"
  • Invoke Find to ensure all tickmarks are present and results are highlighted
    • added: "should have a scroll track marker for every match"
  • Invoke Find with Case sensitive to ensure that all case sensitive matches are found
    • existing: "should find all case-sensitive matches with mixed-case text"
    • existing: "should support case-sensitive regexp"
  • Invoke Find without Case sensitive to ensure that all matches are found
    • existing: "should find all case-insensitive matches with lowercase text"
    • existing: "should find all case-insensitive matches with mixed-case text"
    • existing: "should support case-insensitive regexp"
  • Invoke Find with Regex to ensure that regex is found
    • existing: "should find based on regexp"
    • existing: "should support case-sensitive regexp"
    • existing: "should support case-insensitive regexp"

Replace

  • Invoke Replace with a selection (make sure search text is selection)
    • added: "should get single selection as initial query"
  • Invoke Replace without a selection (make sure search text is empty)
    • added: "should use empty initial query for single cursor selection", and
    • added: "should use empty initial query for multiple cursor selection"
  • Invoke Replace with plain text
    • existing: "should find and replace one string"
    • existing: "should use replace keyboard shortcut for single Replace while search bar open"
  • Invoke Replace All with Plain text to ensure all instances are replaced
    • added: "should find and replace all"
  • Invoke Replace with RegEx
    • existing: "should find and replace a regexp with $n substitutions", etc.
  • Invoke Replace with Regex capture groups and replace parameter
    • existing: "should find and replace a regexp with $n substitutions"
  • Replace Yes/No/Skip to ensure next instance is found
    • added: "should find and skip then replace string"
  • Replace Yes/No/Skip to ensure instance is Replaced or Not
    • added: "should find and skip then replace string"

Find in Files

Added tests for:

  • Results for Project are displayed
  • Results for Folder are displayed
  • Results for File are displayed
  • Start and End offsets are found
  • Dialog is dismissed and Panel is displayed for Results
  • Dialog is kept and Panel is not displayed for No Results
  • More than 100 Results are paginated
    • Doesn't seem like it worth the effort
  • Selecting a Result changes to that file, scrolls to that line, and text is selected
  • Double-click on a Result adds file to Working Set
  • Change one of the find hits to ensure results panel is updated

File Filters

Added tests for:

  • Respect file exclusion filter when searching project
  • Respect file exclusion filter when searching folder
  • Ignore file exclusion filter when searching single file
  • Show error if file exclusion filter results in zero files to search

redmunds included the following code: https://github.com/adobe/brackets/pull/7328/commits

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