Skip to content

Commit a7e2214

Browse files
committed
Update tests for js-yaml v5
Signed-off-by: Martin Kravec <kravciak@gmail.com>
1 parent 8c80943 commit a7e2214

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/e2e/components/rancher-ui.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ export class RancherUI {
145145
// Load yaml from code editor
146146
await expect(this.codeMirror).toBeVisible()
147147
const lines = await this.codeMirror.locator('pre.CodeMirror-line').allTextContents()
148-
const cmYaml = jsyaml.load(lines.join('\n')
148+
const cmText = lines.join('\n')
149149
.replace(/\u00A0/g, ' ') // replace &nbsp; with space
150150
.replace(/\u200B/g, '') // remove ZERO WIDTH SPACE last line
151-
) || {}
151+
const cmYaml = cmText.trim() ? (jsyaml.load(cmText) || {}) : {}
152152

153153
// Edit yaml
154154
if (typeof patch === 'function') {

0 commit comments

Comments
 (0)