Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write unit test for TaskView.get_title() #1083

Merged

Commits on Jun 1, 2024

  1. Write unit test for TaskView.get_title()

    I started to look at getting-things-gnome#1077 and I thought it would be nice to be able to
    unit test this type of thing.
    
    A simple unit test for TaskView would be
    
    * create a task
    * create a view for it
    * check that the title of the view is the title of the task
    
    In the current state of affairs, this is difficult because the code that
    puts the Task data into the view lives in TaskEditor. But we pass a Task
    to the constructor of TaskView, so TaskView actually has all the data it
    needs. So I moved the logic there. I also moved the `is_new()` logic
    from the TaskEditor down to the Task.
    
    I feel like it should be possible to eventually do this in the TaskView
    constructor but for now, TaskEditor calls
    `self.textview.set_text_from_task()` from the same place it used to run
    that code.
    
    The test triggers a segmentation fault when running on GitHub Actions,
    so it's skipped there while I figure out why.
    SqAtx committed Jun 1, 2024
    Configuration menu
    Copy the full SHA
    3f833b4 View commit details
    Browse the repository at this point in the history