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

test: test LayoutOptions with the full task from TaskBuilder #2524

Merged

Conversation

ilandikov
Copy link
Collaborator

@ilandikov ilandikov commented Dec 22, 2023

Description

LayoutOptions are now tested with a hardcoded task. With this PR the test task is taken from TaskBuilder.createFullyPopulatedTask() and the task line parameter is removed from the test helper.

Motivation and Context

  • If a new task field is added
    • It will be seen in the tests (Task field added in TaskBuilder.createFullyPopulatedTask() with // NEW_TASK_FIELD_EDIT_REQUIRED), so the tests are stronger
    • Remove the need to update each test
    • For instance, the CreatedDate field is missing in some tests...
  • Remove redundant data between tests (the task line)

How has this been tested?

Breaking unit tests.

Types of changes

Internal changes:

  • Tests (prefix: test - additions and improvements to unit tests and the smoke tests)

Checklist

  • My code follows the code style of this project and passes yarn run lint.
  • My change has adequate Unit Test coverage.

Terms

@ilandikov ilandikov force-pushed the layout-options-with-full-task branch from c25ce5e to e90d4b0 Compare December 22, 2023 10:45
@claremacrae claremacrae added the type: internal Only regards development or contributing label Dec 26, 2023
@claremacrae
Copy link
Collaborator

Sorry for the delay in getting to this.

When/if you have time, please could you rebase it? I'm not expecting any conflicts: 🤞

@claremacrae claremacrae added the scope: rendering of tasks How the plugin displays tasks (except CSS issues) label Dec 26, 2023
 Same date as in TaskBuilder.createFullyPopulatedTask()
 Same date as in TaskBuilder.createFullyPopulatedTask()
 Same date as in TaskBuilder.createFullyPopulatedTask()
This is a copy of testLayoutOptions() for now, will be simplified
It is unused in the tests where testLayoutOptionsFromLine is used
It will be assumed as `new LayoutOptions()`  in renderListItem()
This way the test order follows the order of rendered components
@ilandikov ilandikov force-pushed the layout-options-with-full-task branch from e90d4b0 to 3b4b390 Compare December 27, 2023 02:22
@ilandikov
Copy link
Collaborator Author

Sorry for the delay in getting to this.

When/if you have time, please could you rebase it? I'm not expecting any conflicts: 🤞

Done =)

@claremacrae claremacrae merged commit d2434c5 into obsidian-tasks-group:main Dec 27, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: rendering of tasks How the plugin displays tasks (except CSS issues) type: internal Only regards development or contributing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants