Skip to content

Conditional rendering testing value of object of forward/backward link#201

Draft
jg10-mastodon-social wants to merge 12 commits intomainfrom
feat/conditional-values
Draft

Conditional rendering testing value of object of forward/backward link#201
jg10-mastodon-social wants to merge 12 commits intomainfrom
feat/conditional-values

Conversation

@jg10-mastodon-social
Copy link
Copy Markdown
Collaborator

@jg10-mastodon-social jg10-mastodon-social commented Apr 18, 2026

Closes #184

  • Add some-value-eq and every-value-eq
  • Add Thing.observeLiterals
  • Support literals for if-property
  • Add (some|every)-value-(gt|gte|lt|lte)
  • Tests have been written
    • all new code is covered by unit tests
    • the happy path of a new feature is covered by an end-to-end test
    • manual explorative tests have been performed
  • all dependencies are updated to the latest patch version at minimum
  • the CI pipeline passes
  • documentation is up-to-date
    • TSDoc style comments on important functions, properties and events
    • stories for new PodOS elements have been added to storybook
    • Readme.md files of PodOS elements have been re-generated
    • N/A- architectural decisions are documented as an ADR
    • Changelogs are updated according to Keep a Changelog

`);
});

it('does not render templates when compareValue indicates that some-value-(lt|lte|gt|gte) is not met (numeric)', async () => {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect we might need more tests here, but I'm not sure how to design them.
I designed these as TDD tests - they all fail if the numbers are treated as strings.

`);
});

it('does not render templates when compareValue indicates that some-value-(lt|lte|gt|gte) is not met (string)', async () => {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests were designed as TDD. By default compareValue returns true, so we test here that it returns false.
Given the default was to return true, I'm not sure it's possible to create failing tests, but it would be possible to write successful tests that show the code works as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conditional rendering testing value of object of forward/backward link

1 participant