File tree Expand file tree Collapse file tree
packages/slice-machine/src/legacy/lib/builders/CustomTypeBuilder/SliceZone
playwright/pages/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
334334 location = { `${ customType . format } _type` }
335335 typeName = { customType . label ?? customType . id }
336336 availableSlices = { availableSlicesToAdd }
337- onSuccess = { ( { slices, library } ) => {
337+ onSuccess = { ( { slices } ) => {
338338 const newCustomType = addSlicesToSliceZone ( {
339339 customType,
340340 tabId,
@@ -343,12 +343,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
343343 setCustomType ( {
344344 customType : CustomTypes . fromSM ( newCustomType ) ,
345345 onSaveCallback : ( ) => {
346- toast . success (
347- < ToastMessageWithPath
348- message = "Slice(s) added to slice zone and created at: "
349- path = { library ?? "" }
350- /> ,
351- ) ;
346+ toast . success ( "Slices successfully added" ) ;
352347 } ,
353348 } ) ;
354349 void completeStep ( "createSlice" ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export class Dialog {
66 readonly title : Locator ;
77 readonly closeButton : Locator ;
88 readonly cancelButton : Locator ;
9- readonly submitButton : Locator ;
9+ protected submitButton : Locator ;
1010
1111 constructor (
1212 page : Page ,
Original file line number Diff line number Diff line change @@ -8,15 +8,20 @@ export class SelectExistingSlicesDialog extends Dialog {
88
99 constructor ( page : Page ) {
1010 super ( page , {
11- title : `Select existing slices` ,
11+ title : "Reuse an existing slice" ,
1212 submitName : "Add" ,
1313 } ) ;
1414
1515 /**
1616 * Static locators
1717 */
1818 this . sharedSliceCard = this . dialog . getByTestId ( "shared-slice-card" ) ;
19- this . addedMessage = page . getByText ( "Slice(s) added to slice zone" , {
19+ this . addedMessage = page . getByText ( "Slices successfully added" , {
20+ exact : true ,
21+ } ) ;
22+ this . submitButton = this . dialog . getByRole ( "button" , {
23+ // Match "Add to <slice zone name> (<number of slices>)"
24+ name : new RegExp ( `^Add to .+ \\(\\d+\\)$` ) ,
2025 exact : true ,
2126 } ) ;
2227 }
You can’t perform that action at this time.
0 commit comments