-
Notifications
You must be signed in to change notification settings - Fork 4.5k
TESTING EXTERNAL SCRIPT: external merge request from Contributor #37791
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
Changes from all commits
2669051
243f6a3
3a96e40
20a37de
f9c6707
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,9 +21,20 @@ describe( | |||||||||||||||||||||
| 200, | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| cy.EvaluateCurrentValue(this.dataSet.base64image.withPrefix); | ||||||||||||||||||||||
| cy.testJsontext("alternativetext", this.dataSet.base64image.altText); | ||||||||||||||||||||||
| cy.wait("@updateLayout").should( | ||||||||||||||||||||||
| "have.nested.property", | ||||||||||||||||||||||
| "response.body.responseMeta.status", | ||||||||||||||||||||||
| 200, | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
|
Comment on lines
+24
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Replace cy.wait with better assertions Instead of using cy.testJsontext("alternativetext", this.dataSet.base64image.altText);
- cy.wait("@updateLayout").should(
- "have.nested.property",
- "response.body.responseMeta.status",
- 200,
- );
+ cy.get("@updateLayout").should((response) => {
+ expect(response.response.body.responseMeta.status).to.equal(200);
+ });📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
| cy.EvaluateCurrentValue(this.dataSet.base64image.altText); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| cy.get(viewWidgetsPage.imageinner) | ||||||||||||||||||||||
| .invoke("attr", "src") | ||||||||||||||||||||||
| .should("contain", this.dataSet.base64image.withPrefix); | ||||||||||||||||||||||
| cy.get(viewWidgetsPage.imageinner) | ||||||||||||||||||||||
| .invoke("attr", "alt") | ||||||||||||||||||||||
| .should("contain", this.dataSet.base64image.altText); | ||||||||||||||||||||||
| cy.closePropertyPane(); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -38,6 +38,13 @@ describe( | |||||||||||||||||||||||||||||||
| cy.get(viewWidgetsPage.imageinner) | ||||||||||||||||||||||||||||||||
| .invoke("attr", "src") | ||||||||||||||||||||||||||||||||
| .should("contain", this.dataSet.validateImage); | ||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||
| * @param{TEXT} Alternative text | ||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||
| cy.testCodeMirrorLast(this.dataSet.NewImageAltText); | ||||||||||||||||||||||||||||||||
| cy.get(viewWidgetsPage.imageinner) | ||||||||||||||||||||||||||||||||
| .invoke("attr", "alt") | ||||||||||||||||||||||||||||||||
| .should("contain", this.dataSet.validateImageAltText); | ||||||||||||||||||||||||||||||||
|
Comment on lines
+41
to
+47
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Alt text validation looks good, but remove cy.wait usage The alt text validation is well implemented using the correct selector and fixture data. However, there's a Replace the wait with an assertion: - cy.wait(1000);
+ cy.get(viewWidgetsPage.imageinner).should('exist');📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||
| cy.closePropertyPane(); | ||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -92,9 +92,11 @@ | |||||
| "multiSelectName": "MultiSelect1", | ||||||
| "defaultimage": "https://i0.wp.com/www.heyuguys.com/images/2016/04/The-Joker.png?fit=1920%2C960", | ||||||
| "NewImage": "https://cdn.dribbble.com/users/1787323/screenshots/4563995/dribbbe_hammer-01.png", | ||||||
| "NewImageAltText": "Thor's hammer planted into the ground", | ||||||
| "base64image": { | ||||||
| "withoutPrefix": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg==", | ||||||
| "withPrefix": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg==" | ||||||
| "withPrefix": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg==", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the trailing comma in base64 string. The base64 string in Apply this diff to fix the trailing comma: - "withPrefix": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg==",
+ "withPrefix": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg=="📝 Committable suggestion
Suggested change
|
||||||
| "altText": "A single pixel" | ||||||
| }, | ||||||
| "textfun": "{{Table1.selectedRow.userName}}", | ||||||
| "textfunID": "{{Table1.selectedRow.id}}", | ||||||
|
|
@@ -118,6 +120,7 @@ | |||||
| "RichTexteditorBody": "Here is the text area to edit html", | ||||||
| "userApi": "http://host.docker.internal:5001/v1", | ||||||
| "validateImage": "https://cdn.dribbble.com/users/1787323/screenshots/4563995/dribbbe_hammer-01.png", | ||||||
| "validateImageAltText": "Thor's hammer planted into the ground", | ||||||
| "defaultdata": "TestData", | ||||||
| "label": "one", | ||||||
| "rgbValue": "rgb(255, 0, 0)", | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -133,6 +133,23 @@ class ImageWidget extends BaseWidget<ImageWidgetProps, WidgetState> { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isTriggerProperty: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| validation: { type: ValidationTypes.IMAGE_URL }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| helpText: "Sets alternative text for the image", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| propertyName: "alt", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label: "Alternative text", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| controlType: "INPUT_TEXT", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| placeholderText: "Alternative text", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isBindProperty: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defaultValue: "", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isTriggerProperty: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| validation: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: ValidationTypes.TEXT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| params: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxLength: 125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+136
to
+152
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove required validation for alt property The alt property should remain optional as there are fallback values when users don't provide alternative text. Apply this diff to fix the validation: validation: {
type: ValidationTypes.TEXT,
params: {
- required: true,
maxLength: 125
}
},📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -328,6 +345,7 @@ class ImageWidget extends BaseWidget<ImageWidgetProps, WidgetState> { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disableDrag={(disable: boolean) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.disableDrag(disable); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alt={this.props.alt ? this.props.alt : undefined} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enableDownload={this.props.enableDownload} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enableRotation={this.props.enableRotation} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| imageUrl={this.props.image} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -368,6 +386,7 @@ export interface ImageWidgetProps extends WidgetProps { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| borderRadius: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| boxShadow?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alt?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export default ImageWidget; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
kindly remove waits.