forked from superdesk/superdesk-planning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7eebef9
commit c4fa3cd
Showing
2 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {Popup} from './popup'; | ||
|
||
export class UiFrameworkModal extends Popup { | ||
/** | ||
* Creates an instance of the Modal wrapper | ||
* @param {string} selector - The CSS selector to find the modal | ||
*/ | ||
constructor(selector = '.p-dialog') { | ||
super(selector); | ||
} | ||
|
||
get footer() { | ||
return this.element.find('.p-dialog-footer'); | ||
} | ||
|
||
/** | ||
* Returns the dom node for a specific button in the footer | ||
* @param {string} label - The label on the button | ||
* @param {number} timeout - The ms timeout when getting the button | ||
* @returns {Cypress.Chainable<JQuery<HTMLElement>>} | ||
*/ | ||
getFooterButton(label, timeout = 3000, shouldExist = true) { | ||
return this.element.find('.p-dialog-footer') | ||
.contains(label, {timeout: timeout}) | ||
.should('exist'); | ||
} | ||
|
||
shouldContainTitle(title: string) { | ||
return this.element.find('.p-dialog-header') | ||
.should('exist') | ||
.contains(title); | ||
} | ||
} |