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

E2E test coverage for "Highlight the selected data source in the notebook editor" project #40199

Merged
merged 12 commits into from
Mar 18, 2024

Conversation

nemanjaglumac
Copy link
Member

@nemanjaglumac nemanjaglumac commented Mar 15, 2024

This PR adds a test coverage for #39542
Closes #39542
Closes #39544
Closes #25142

Reproduces #25142
Reproduces #40223

@nemanjaglumac nemanjaglumac added the backport Automatically create PR on current release branch on merge label Mar 15, 2024
Copy link

replay-io bot commented Mar 15, 2024

Status Complete ↗︎
Commit ff0d350
Results
⚠️ 13 Flaky
2356 Passed

@nemanjaglumac nemanjaglumac changed the title Hds/e2e coverage [WIP] E2E test coverage for "Highlight the selected data source in the notebook editor" project Mar 15, 2024
Comment on lines +56 to +58
/**
* @type number
*/
Copy link
Member Author

Choose a reason for hiding this comment

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

Before we end up converting all helpers to TS, some of the monkey-patching will be needed because TS complains in TS specs.

@nemanjaglumac nemanjaglumac requested a review from a team March 15, 2024 19:54
Copy link
Contributor

@kamilmielnik kamilmielnik left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines 196 to 202
const modelDetails = {
name: "GUI Model",
query: { "source-table": REVIEWS_ID, limit: 1 },
display: "table",
type: "model",
collection_id: SECOND_COLLECTION_ID,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Only modelDetails.name is used later on.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok?
I mostly extract this for readability.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this object was meant to be passed to createQuestion but instead a different (identical) object is passed there - this duplication looks like a leftover.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, could be.
Will take a look at it. Thank you.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was stuck at a discrepancy between how the data picker works in OSS vs EE mode so I might have missed a few other details. Thanks again.
#40223

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed this comment in d32bd0e

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO the best way out is to explicitly define the type of modelDetails, like this: const modelDetails: Parameters<typeof cy.createQuestion>[0] = {. No casting and we get a proper type check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good.
But my only concern is what happens if we ever decide to change the order in the future?

@kamilmielnik kamilmielnik requested a review from a team March 18, 2024 08:59
@nemanjaglumac
Copy link
Member Author

nemanjaglumac commented Mar 18, 2024

@nemanjaglumac nemanjaglumac merged commit 936e38a into master Mar 18, 2024
105 checks passed
@nemanjaglumac nemanjaglumac deleted the hds/e2e-coverage branch March 18, 2024 14:28
github-actions bot pushed a commit that referenced this pull request Mar 18, 2024
…book editor" project (#40199)

* Add the initial test for the empty app db

* Add reproduction for #25142

* Add test that covers only saved questions

* Cover scenarios with a table as a source

* Add tests that cover nested questions and models

* Add test for simple model's source table

* Remove intercepted schema routes

* Improve assertion

* Fix the test failing on enterprise instance

* Add E2E reproduction for #40223

* Remove superfluous code block

* Avoid casting
metabase-bot bot added a commit that referenced this pull request Mar 19, 2024
…book editor" project (#40199) (#40243)

* Add the initial test for the empty app db

* Add reproduction for #25142

* Add test that covers only saved questions

* Cover scenarios with a table as a source

* Add tests that cover nested questions and models

* Add test for simple model's source table

* Remove intercepted schema routes

* Improve assertion

* Fix the test failing on enterprise instance

* Add E2E reproduction for #40223

* Remove superfluous code block

* Avoid casting

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Automatically create PR on current release branch on merge .CI & Tests support/Repro .Team/QueryingComponents
Projects
None yet
2 participants