add test attributes to help locate buttons
This commit is contained in:
@@ -55,6 +55,7 @@ export class UmbUpgraderView extends LitElement {
|
||||
? html`
|
||||
<p>
|
||||
<uui-button
|
||||
data-test="view-report-button"
|
||||
look="secondary"
|
||||
href="${this.settings.reportUrl}"
|
||||
target="_blank"
|
||||
@@ -69,6 +70,7 @@ export class UmbUpgraderView extends LitElement {
|
||||
<form id="authorizeUpgradeForm" @submit=${this._handleSubmit}>
|
||||
<p>
|
||||
<uui-button
|
||||
data-test="continue-button"
|
||||
id="authorizeUpgrade"
|
||||
type="submit"
|
||||
look="primary"
|
||||
@@ -84,7 +86,9 @@ export class UmbUpgraderView extends LitElement {
|
||||
}
|
||||
|
||||
private _renderError() {
|
||||
return html` ${this.errorMessage ? html`<p class="error">${this.errorMessage}</p>` : ''} `;
|
||||
return html`
|
||||
${this.errorMessage ? html`<p class="error" data-test="error-message">${this.errorMessage}</p>` : ''}
|
||||
`;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -5,7 +5,8 @@ import { html, LitElement } from 'lit';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
|
||||
import { getUpgradeSettings, PostUpgradeAuthorize } from '../core/api/fetcher';
|
||||
import { UmbracoUpgrader } from '../core/models';
|
||||
|
||||
import type { UmbracoUpgrader } from '../core/models';
|
||||
|
||||
/**
|
||||
* @element umb-upgrader
|
||||
@@ -30,7 +31,7 @@ export class UmbUpgrader extends LitElement {
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`<umb-installer-layout>
|
||||
return html`<umb-installer-layout data-test="upgrader">
|
||||
<umb-upgrader-view
|
||||
.fetching=${this.fetching}
|
||||
.upgrading=${this.upgrading}
|
||||
@@ -49,7 +50,7 @@ export class UmbUpgrader extends LitElement {
|
||||
this.upgradeSettings = data;
|
||||
} catch (e) {
|
||||
if (e instanceof getUpgradeSettings.Error) {
|
||||
this.errorMessage = e.message;
|
||||
this.errorMessage = e.data.detail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user