Skip to content

test(repositories): make the user-subscription spec independent of the time zone - #1001

Merged
cameri merged 2 commits into
cameri:mainfrom
Priyanshubhartistm:test/user-subscription-spec-timezone
Oct 29, 2026
Merged

cameri merged 2 commits into
cameri:mainfrom
Priyanshubhartistm:test/user-subscription-spec-timezone

Conversation

@Priyanshubhartistm

@Priyanshubhartistm Priyanshubhartistm commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

user-subscription-repository.spec.ts asserted that a literal like '2026-01-31 appears in the generated SQL. The driver prints a date in the local time zone of the machine, so the literal only matched in UTC and to the east of it, and five tests failed anywhere west of it (the three findDueForRenewal, findPeriodEnded and findGraceEnded bounds, and the two updateIfCurrent IS NOT DISTINCT FROM clauses).

The spec now prints the expected date the same way the driver does (real.raw('?', [date])) and asserts on that, so it still checks that the exact instant it was given is the one in the statement. Only the spec changes.

Related Issue

Closes #971

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

…e time zone

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
@changeset-bot

changeset-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 53b8ea6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

Makes five date assertions in user-subscription-repository.spec.ts independent of the machine’s time zone.

  • Repository date checks now use Knex's local SQL date format.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into test/user-subsc..." · Reviewed by Greptile

@coveralls

coveralls commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 40844125828

Coverage increased (+0.006%) to 76.754%

Details

  • Coverage increased (+0.006%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 11759
Covered Lines: 9419
Line Coverage: 80.1%
Relevant Branches: 6162
Covered Branches: 4336
Branch Coverage: 70.37%
Branches in Coverage %: Yes
Coverage Strength: 780.48 hits per line

💛 - Coveralls

@cameri
cameri merged commit 7585174 into cameri:main Oct 29, 2026
15 checks passed
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.

test: user-subscription specs fail outside UTC, so the pre-commit hook cannot pass

3 participants