Unit test ExportDialog (#7619)
* add test ids to dialog buttons Signed-off-by: Kerry Archibald <kerrya@element.io> * unit test ExportDialog Signed-off-by: Kerry Archibald <kerrya@element.io> * remove extra snapshot Signed-off-by: Kerry Archibald <kerrya@element.io> * fix bad snapshots Signed-off-by: Kerry Archibald <kerrya@element.io> * remove wrappers from snapshot Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
@@ -83,6 +83,7 @@ export default class DialogButtons extends React.Component<IProps> {
|
||||
cancelButton = <button
|
||||
// important: the default type is 'submit' and this button comes before the
|
||||
// primary in the DOM so will get form submissions unless we make it not a submit.
|
||||
data-test-id="dialog-cancel-button"
|
||||
type="button"
|
||||
onClick={this.onCancelClick}
|
||||
className={this.props.cancelButtonClass}
|
||||
@@ -103,6 +104,7 @@ export default class DialogButtons extends React.Component<IProps> {
|
||||
{ cancelButton }
|
||||
{ this.props.children }
|
||||
<button type={this.props.primaryIsSubmit ? 'submit' : 'button'}
|
||||
data-test-id="dialog-primary-button"
|
||||
className={primaryButtonClassName}
|
||||
onClick={this.props.onPrimaryButtonClick}
|
||||
autoFocus={this.props.focus}
|
||||
|
||||
Reference in New Issue
Block a user