-
Notifications
You must be signed in to change notification settings - Fork 365
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: [M3-7083 & M3-7175] MarketPlace regex fix + end to end coverage #9704
Conversation
1411e0c
to
b1cfef5
Compare
@@ -9,6 +9,7 @@ | |||
"moduleResolution": "node", | |||
"lib": ["es6", "dom"], | |||
"baseUrl": "..", | |||
"jsx": "react", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was necessary to remove an import warning when importing a utility from a .tsx
extension
const label = isCluster | ||
? decodedLabel.split(' Cluster')[0] | ||
: decodedLabel; | ||
const { decodedLabel, isCluster, label } = handleAppLabel(eachApp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to a util so it's reusable and testable in isolation.
const trimmedApps = filteredApps.map((stackscript) => | ||
trimOneClickFromLabel(stackscript) | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Moved to a util. This helps testing in isolation and re-use as an assertion in the e2e test.
'hashicorp nomad clients cluster', | ||
'hashicorp nomad cluster', | ||
].includes(app.label.toLowerCase().trim()); | ||
return newAppsIds.includes(app.id.toString()); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we were hardcoding those since they are already returning from the oneClickApps feature flag. This fix also makes the New Apps selection more robust since it references the Id rather than a label. This is the reason for passing the flags from the Class Component to the selection panel. (also a class component so no useFlag
hook there...)
Confirmed with @HanaXu this was the right thing to do.
|
||
const cleanedAppName = app.name.replace('®', ''); | ||
|
||
return cleanedStackScriptLabel === cleanedAppName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved to https://github.com/linode/manager/pull/9704/files#diff-218af8db6da1dc4532edcb6cab99724a4363a16c0fdbbf78557ab9d3acf23e54R14 below, where the regex has been fixed to remove the codeQL warning
data-qa-drawer | ||
data-testid="drawer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data-qa-drawer | |
data-testid="drawer" | |
data-qa-drawer | |
data-testid="drawer" |
Nice catch. Curious what's special about this drawer that we need to use the MUI component and re-implement these attributes and the close button instead of using the component in src/components/Drawer.tsx
Edit: Oh never mind, I forgot that this drawer has the really nice styling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i thought about moving it to our drawer but it would have expanded the scope too much cause I would have had to add props to our Drawer etc. for another time 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @abailly-akamai! Tests look good and are passing for me, and manually testing OCA I wasn't able to notice any regressions or differences between this and Prod.
cy.scrollTo(0, 0); | ||
const initialNumberOfApps = trimmedApps.length; | ||
cy.findByPlaceholderText('Search for app name') | ||
.should('exist') | ||
.type(candidate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cy.scrollTo(0, 0); | |
const initialNumberOfApps = trimmedApps.length; | |
cy.findByPlaceholderText('Search for app name') | |
.should('exist') | |
.type(candidate); | |
const initialNumberOfApps = trimmedApps.length; | |
cy.findByPlaceholderText('Search for app name') | |
.scrollIntoView() | |
.should('be.visible') | |
.type(candidate); |
This might be slightly clearer about what the test is trying to do but very minor difference
Description 📝
This PR achieves a few things:
Preview 📷
This PR aims to introduce no visual change or regression
How to test 🧪
yarn cy:debug
and runone-click-apps.spec.ts