Skip to content

Commit

Permalink
chore(e2e): fix rebase ts errors
Browse files Browse the repository at this point in the history
Signed-off-by: Zacharias Fragkiadakis <zacfragkiadakis@gmail.com>
  • Loading branch information
QZera committed Dec 30, 2024
1 parent 9e7760d commit 974327c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/e2e/specs/settings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { browser } from '@wdio/globals'
import type { Setting, SettingsEditor, Workbench } from 'wdio-vscode-service'
import isEqual from 'lodash/isEqual'
import { type ChainablePromiseElement, Key } from 'webdriverio'
import { Key } from 'webdriverio'
import { $ } from 'zx'
import { getFirstWelcomeViewText } from '../helpers/queries'
import { expectCliCommandsAndPatchesToBeVisible } from '../helpers/assertions'
import { closeRadicleViewContainer, openRadicleViewContainer } from '../helpers/actions'
import { pathToNodeHome } from '../constants/config'
import { nodeHomePath } from '../constants/config'

describe('Settings', () => {
let workbench: Workbench
Expand Down Expand Up @@ -48,8 +48,8 @@ describe('Settings', () => {
})

it('recognizes the rad binary when a valid path is specified', async () => {
const tempNodeHomePath = `${pathToNodeHome}.temp`
await $`cp -r ${pathToNodeHome} ${tempNodeHomePath}`
const tempNodeHomePath = `${nodeHomePath}.temp`
await $`cp -r ${nodeHomePath} ${tempNodeHomePath}`

await setTextSettingValue(pathToRadBinarySetting, `/tmp`)

Expand All @@ -65,13 +65,13 @@ describe('Settings', () => {
// This functionality does not seem to work
// eslint-disable-next-line max-len
it.skip('recognizes if the directory is created *after* the setting is updated', async () => {
const tempNodeHomePath = `${pathToNodeHome}.temp`
const tempNodeHomePath = `${nodeHomePath}.temp`

await setTextSettingValue(pathToRadBinarySetting, tempNodeHomePath)

await expectRadBinaryNotFoundToBeVisible(workbench)

await $`cp -r ${pathToNodeHome} ${tempNodeHomePath}`
await $`cp -r ${nodeHomePath} ${tempNodeHomePath}`

await expectCliCommandsAndPatchesToBeVisible(workbench)

Expand Down Expand Up @@ -106,16 +106,12 @@ async function expectRadBinaryNotFoundToBeVisible(workbench: Workbench) {
)
}

function getTextSettingInput(setting: Setting) {
return setting.textSetting$ as ChainablePromiseElement
}

/**
* Workaround to get the value of a `TextSetting`.
* The `getValue` method of a `TextSetting` seems to be wrongly implemented and returns null.
*/
async function getTextSettingValue(setting: Setting) {
return await getTextSettingInput(setting).getValue()
return await setting.textSetting$.getValue()
}

async function setTextSettingValue(setting: Setting, value: string) {
Expand All @@ -135,7 +131,7 @@ async function clearTextSetting(setting: Setting) {
return
}

await getTextSettingInput(setting).click()
await setting.textSetting$.click()
await browser.keys([Key.Ctrl, 'a'])
await browser.keys(Key.Backspace)
}

0 comments on commit 974327c

Please sign in to comment.