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

Fix ConnectionEditService test #17698

Conversation

lmossman
Copy link
Contributor

@lmossman lmossman commented Oct 6, 2022

No description provided.

@github-actions github-actions bot added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Oct 6, 2022
@lmossman lmossman changed the base branch from master to kc/connection-form-refactor-part-two October 6, 2022 20:31
Comment on lines +23 to +25
mutateAsync: jest.fn(async (connection: WebBackendConnectionUpdate) => {
return { ...mockConnection, ...connection };
}),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes the mocked hook a patch-style update rather than a full replace, so it more closely matches the behavior of the backend update API

@krishnaglick
Copy link
Contributor

Merged in latest in an attempt to fix CI

Copy link
Contributor

@krishnaglick krishnaglick left a comment

Choose a reason for hiding this comment

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

I don't think this hurts anything. 👍

@krishnaglick krishnaglick marked this pull request as ready for review October 7, 2022 15:21
@krishnaglick krishnaglick requested a review from a team as a code owner October 7, 2022 15:21
@krishnaglick krishnaglick merged commit ce49bdf into kc/connection-form-refactor-part-two Oct 7, 2022
@krishnaglick krishnaglick deleted the lmossman/fix-connection-edit-service-test branch October 7, 2022 15:21
krishnaglick added a commit that referenced this pull request Oct 7, 2022
* Work started

* Minor cleanup

* Some cleanup

* Lots moved into context

* WIP, stepping in the right direction

* WIP testing

* Post-merge fix

* Observables!

* WIP tests

* Tests!

* CI test

* CI?

* perhaps

* Only show name field during create

* Fix Build

* Fix build

* Fixing a bug

* Fix failing test

* Fixes e2e

* Type consolidation

* useCallback, improvements to connection create onAfter, and removing dirty tracking

* cleanup

* Removing an unused prop

* errorStatusMessage and mapFormPropsToOperation tests

* useUniqueFormId and useInitialValues tests

* Cleanup, onFrequencySelect is moved to its use location, better test wrapper,  and expanding use of FormError

* Better formSubmit handling for new connection

* Commenting and some cleanup

* Comments!

* Fixing errors from the merge

* mock data cleanup

* Better TODO

* onFrequencySelect is now always called

* Edmundo CR

* Remove whitespace

* Move connection into state so it gets updated

* Consolidate on connection object

* Remove ModalCancel throw + form clearing in create submit function

* Some cleanup

* Fixing error

* Fixing build error

* Rename file

* Bridging changes to bring things inline

* Builds and tests run

* replication view almost works as expected

* About to embark on another huge change! Committing here before I break more things.

* slowly, unity

* Code appears to be working

* Some minor cleanup

* Form dirty change tracking

* WIP styling moving and fixing

* skip refresh on update if status !== active

* Fixing styles

* Minor

* More cleanup and improvements

* Rename CreateConnectionContent -> CreateConnection

* refreshSchema moved into the connection form service

* Re-add TODO

* schemaErrorStatus => schemaError

* CreateConnectionName -> CreateConnectionNameField

* Logic for readonly vs edit

* Added TODO, fixed a re-initialize issue

* Remove unused ConnectionForm component

* Improved refresh schema logic

* undoing some of the cancel work as it felt like the wrong place to do it

* No longer need to know if the status is updating, that info is available from the form edit context

* Move close modal & confirmation modal logic to where it's used

* Remove unnecessary useUnmount

* Cleanup and removal of unused

* Somehow missed removing this

* Fixing failing test

* Added missing initialvalues logic. Added connection form service tests.

* Connection Edit tests!

* connection replication test pt 1

* Moving files to make master merge easier

* Remove snapshot

* non-default export

* Remove unused

* Minor improvements

* Edmundo CR.

* name now optional for connection editing

* Schema refresh errors handled on connection replication view

* schema refreshing logic, confirm catalog dialog abstraction

* CreateConnection -> CreateConnectionForm

* form config test cleanup

* connection replication tab tests

* Create Connection Form Tests

* Better jest mocking!

* Fixing issue setting schedule type to manual

* Tests fixed, and test-utils is better!

* Changing back to Once

* Fixing build from master merge

* Updating snapshots. If these change a lot it may be worth altering the tests to avoid snapshots.

* Edmundo & Lake Code Review Comments

* Tim CR

* Fixing a styling issue

* ?? is less clever than I thought

* Form change tracking has been improved to not leave dirty forms around. As well as it has been moved into ConnectionFormFields for DRY purposes

* Update airbyte-webapp/src/hooks/services/ConnectionForm/ConnectionFormService.tsx

Co-authored-by: Lake Mossman <lake@airbyte.io>

* Update airbyte-webapp/src/hooks/services/ConnectionEdit/ConnectionEditService.test.tsx

Co-authored-by: Lake Mossman <lake@airbyte.io>

* Update airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionReplicationTab.tsx

Co-authored-by: Lake Mossman <lake@airbyte.io>

* DRY out tests

* remove unknowns and fix mocked hook to be patch-style (#17698)

Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io>

* Self-CR

* idk why this was an issue but whatever

* Update airbyte-webapp/src/hooks/services/ConnectionForm/ConnectionFormService.test.tsx

Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>

* Update airbyte-webapp/src/hooks/services/ConnectionEdit/ConnectionEditService.test.tsx

Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>

Co-authored-by: Lake Mossman <lake@airbyte.io>
Co-authored-by: tealjulia <teal@airbyte.io>
Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
jhammarstedt pushed a commit to jhammarstedt/airbyte that referenced this pull request Oct 31, 2022
* Work started

* Minor cleanup

* Some cleanup

* Lots moved into context

* WIP, stepping in the right direction

* WIP testing

* Post-merge fix

* Observables!

* WIP tests

* Tests!

* CI test

* CI?

* perhaps

* Only show name field during create

* Fix Build

* Fix build

* Fixing a bug

* Fix failing test

* Fixes e2e

* Type consolidation

* useCallback, improvements to connection create onAfter, and removing dirty tracking

* cleanup

* Removing an unused prop

* errorStatusMessage and mapFormPropsToOperation tests

* useUniqueFormId and useInitialValues tests

* Cleanup, onFrequencySelect is moved to its use location, better test wrapper,  and expanding use of FormError

* Better formSubmit handling for new connection

* Commenting and some cleanup

* Comments!

* Fixing errors from the merge

* mock data cleanup

* Better TODO

* onFrequencySelect is now always called

* Edmundo CR

* Remove whitespace

* Move connection into state so it gets updated

* Consolidate on connection object

* Remove ModalCancel throw + form clearing in create submit function

* Some cleanup

* Fixing error

* Fixing build error

* Rename file

* Bridging changes to bring things inline

* Builds and tests run

* replication view almost works as expected

* About to embark on another huge change! Committing here before I break more things.

* slowly, unity

* Code appears to be working

* Some minor cleanup

* Form dirty change tracking

* WIP styling moving and fixing

* skip refresh on update if status !== active

* Fixing styles

* Minor

* More cleanup and improvements

* Rename CreateConnectionContent -> CreateConnection

* refreshSchema moved into the connection form service

* Re-add TODO

* schemaErrorStatus => schemaError

* CreateConnectionName -> CreateConnectionNameField

* Logic for readonly vs edit

* Added TODO, fixed a re-initialize issue

* Remove unused ConnectionForm component

* Improved refresh schema logic

* undoing some of the cancel work as it felt like the wrong place to do it

* No longer need to know if the status is updating, that info is available from the form edit context

* Move close modal & confirmation modal logic to where it's used

* Remove unnecessary useUnmount

* Cleanup and removal of unused

* Somehow missed removing this

* Fixing failing test

* Added missing initialvalues logic. Added connection form service tests.

* Connection Edit tests!

* connection replication test pt 1

* Moving files to make master merge easier

* Remove snapshot

* non-default export

* Remove unused

* Minor improvements

* Edmundo CR.

* name now optional for connection editing

* Schema refresh errors handled on connection replication view

* schema refreshing logic, confirm catalog dialog abstraction

* CreateConnection -> CreateConnectionForm

* form config test cleanup

* connection replication tab tests

* Create Connection Form Tests

* Better jest mocking!

* Fixing issue setting schedule type to manual

* Tests fixed, and test-utils is better!

* Changing back to Once

* Fixing build from master merge

* Updating snapshots. If these change a lot it may be worth altering the tests to avoid snapshots.

* Edmundo & Lake Code Review Comments

* Tim CR

* Fixing a styling issue

* ?? is less clever than I thought

* Form change tracking has been improved to not leave dirty forms around. As well as it has been moved into ConnectionFormFields for DRY purposes

* Update airbyte-webapp/src/hooks/services/ConnectionForm/ConnectionFormService.tsx

Co-authored-by: Lake Mossman <lake@airbyte.io>

* Update airbyte-webapp/src/hooks/services/ConnectionEdit/ConnectionEditService.test.tsx

Co-authored-by: Lake Mossman <lake@airbyte.io>

* Update airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionReplicationTab.tsx

Co-authored-by: Lake Mossman <lake@airbyte.io>

* DRY out tests

* remove unknowns and fix mocked hook to be patch-style (airbytehq#17698)

Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io>

* Self-CR

* idk why this was an issue but whatever

* Update airbyte-webapp/src/hooks/services/ConnectionForm/ConnectionFormService.test.tsx

Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>

* Update airbyte-webapp/src/hooks/services/ConnectionEdit/ConnectionEditService.test.tsx

Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>

Co-authored-by: Lake Mossman <lake@airbyte.io>
Co-authored-by: tealjulia <teal@airbyte.io>
Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants