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(app): updated specs to fit with new API #587

Merged
merged 26 commits into from
Apr 6, 2023
Merged

Conversation

seaerchin
Copy link
Contributor

@seaerchin seaerchin commented Dec 9, 2022

Problem

Part of #585, where the specs failed due to the API changes. This PR fixes the failing tests; most of the fixes are mostly cosmetic but here are a few meaningful changes described below.

Solution

  1. rework tests to unwrap value
  2. for SitesService.spec, the spec where it("should return UnprocessableError when the GitHub commit is not found") has been altered to only assert that the service is called once. This is because we now short circuit when either the prod/staging commit could not be fetched, rather than continuing on with the code flow. This is because both staging/prod commit contain info that we use to derive properties without which the flow isn't meaningful anymore.

@seaerchin seaerchin changed the base branch from develop to feat/buttons December 9, 2022 07:02
src/services/identity/SitesService.ts Outdated Show resolved Hide resolved
src/errors/DatabaseError.ts Outdated Show resolved Hide resolved
src/integration/Sites.spec.ts Outdated Show resolved Hide resolved
@seaerchin seaerchin merged commit 32af48b into feat/buttons Apr 6, 2023
@seaerchin seaerchin deleted the test/buttons branch April 6, 2023 09:23
seaerchin added a commit that referenced this pull request Apr 10, 2023
* feat(reviewrequestservice): add initial impl to copute url

* chore(errors): add many errors

* feat(types): add types

* refactor(deployment): chaneg string type to permalink

* feat(pageservice): add new pageservice abstration for raw js wrappers

* feat(json): add new safeJsonParse util

* refactor(reviewrequestservice): refactor to use new page service

* refactor(sitesservice): refactor to use new page service

* refactor(review): refactor for neverthrow api

* chore(server): init page service

* chore(pageservice): add comment

* fix(reviewrequestservice): add in await

* fix(collaboratorsservice): add in unwrap

* chore(review.ts): removed vapt fixes

* chore(services/types): renamed variables and methods for clarity

* chore(errors): removed unneeded properties

* fix(server): u9pdate after rebase

* fix(review): update after rebase

* fix(rebase fixes): add cast cos the `permalink` property is guaranteed but it's opaque atm

* chore(server): add code for init of pageservice

* chore(rr service): specify return types

* fix(notif handler): update to fit new api

* test(app): updated specs to fit with new API   (#587)

* fix(sites.spec): update imports

* test(sitesservice): update types

* test(reviewrequestservice.spec): update spce

* test(collaboratorsservice): fixed tests

* chore(databaseerror): add new error

* fix(sitesservice): fixed regression in code

* test(sitesservice.spec): fixed tests

* chore(sitesservice): remove extra console log

* chore(sites/user spec): add sync to prevent db clash

* chore(databaseerror): removed extra properties

* chore(constants): add new constant for homepage name

* fix(pageservice): fixed bug allowing empty collections

* chore(constants): add new constant for contact-us

* refactor(pages): rename property

* test(pageservice.spec): add tests

* chore(constants): rename homepage constants for consistency

* chore(pageservice): remove redundant code

* chore(pageservice.spec,): remove extra async

* chore(pageservice.spec): standardise imports

\

* refactor(pageservice): update parsecolletionpage

* test(pageservice.spec): update tests for new error mesasge

* fix(pageservice.spec): removed extra newline

* test(integration): fixed reviews integration tests

* test(review): updated spec for new api

* tests(notifs + page): fixed failing tests

* test(review): fix for dev changes
alexanderleegs pushed a commit that referenced this pull request Apr 11, 2023
* feat(reviewrequestservice): add initial impl to copute url

* chore(errors): add many errors

* feat(types): add types

* refactor(deployment): chaneg string type to permalink

* feat(pageservice): add new pageservice abstration for raw js wrappers

* feat(json): add new safeJsonParse util

* refactor(reviewrequestservice): refactor to use new page service

* refactor(sitesservice): refactor to use new page service

* refactor(review): refactor for neverthrow api

* chore(server): init page service

* chore(pageservice): add comment

* fix(reviewrequestservice): add in await

* fix(collaboratorsservice): add in unwrap

* chore(review.ts): removed vapt fixes

* chore(services/types): renamed variables and methods for clarity

* chore(errors): removed unneeded properties

* fix(server): u9pdate after rebase

* fix(review): update after rebase

* fix(rebase fixes): add cast cos the `permalink` property is guaranteed but it's opaque atm

* chore(server): add code for init of pageservice

* chore(rr service): specify return types

* fix(notif handler): update to fit new api

* test(app): updated specs to fit with new API   (#587)

* fix(sites.spec): update imports

* test(sitesservice): update types

* test(reviewrequestservice.spec): update spce

* test(collaboratorsservice): fixed tests

* chore(databaseerror): add new error

* fix(sitesservice): fixed regression in code

* test(sitesservice.spec): fixed tests

* chore(sitesservice): remove extra console log

* chore(sites/user spec): add sync to prevent db clash

* chore(databaseerror): removed extra properties

* chore(constants): add new constant for homepage name

* fix(pageservice): fixed bug allowing empty collections

* chore(constants): add new constant for contact-us

* refactor(pages): rename property

* test(pageservice.spec): add tests

* chore(constants): rename homepage constants for consistency

* chore(pageservice): remove redundant code

* chore(pageservice.spec,): remove extra async

* chore(pageservice.spec): standardise imports

\

* refactor(pageservice): update parsecolletionpage

* test(pageservice.spec): update tests for new error mesasge

* fix(pageservice.spec): removed extra newline

* test(integration): fixed reviews integration tests

* test(review): updated spec for new api

* tests(notifs + page): fixed failing tests

* test(review): fix for dev changes
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.

2 participants