Skip to content

Commit

Permalink
now we show dialogs on edit variant (#28292)
Browse files Browse the repository at this point in the history
  • Loading branch information
zJaaal authored Apr 22, 2024
1 parent 24eea44 commit 38174b1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
(dragEnd)="onDragEnd($event)"
data-testId="palette" />

@if(es.editorData.canEditVariant && es.editorData.mode === editorMode.EDIT) {
@if(es.editorData.canEditVariant && (es.editorData.mode === editorMode.EDIT ||
es.editorData.mode === editorMode.EDIT_VARIANT)) {
<dot-edit-ema-dialog
#dialog
(action)="onCustomEvent($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,29 @@ describe('EditEmaEditorComponent', () => {
expect(confirmDialog.getAttribute('acceptIcon')).toBe('hidden');
expect(confirmDialog.getAttribute('rejectIcon')).toBe('hidden');
});

it('should show the dialogs when we can edit a variant', () => {
const componentsToHide = ['dialog', 'confirm-dialog']; // Test id of components that should hide when entering preview modes

spectator.detectChanges();

spectator.activatedRouteStub.setQueryParam('variantName', 'hello-there');

spectator.detectChanges();
store.load({
url: 'index',
language_id: '5',
'com.dotmarketing.persona.id': DEFAULT_PERSONA.identifier,
variantName: 'hello-there',
experimentId: 'i have a variant'
});

spectator.detectChanges();

componentsToHide.forEach((testId) => {
expect(spectator.query(byTestId(testId))).not.toBeNull();
});
});
});

describe('move contentlet', () => {
Expand Down

0 comments on commit 38174b1

Please sign in to comment.