Skip to content

Commit

Permalink
test(e2e): write test for setting a valid node home path
Browse files Browse the repository at this point in the history
Signed-off-by: Zacharias Fragkiadakis <zacfragkiadakis@gmail.com>
  • Loading branch information
QZera committed Jan 4, 2025
1 parent 110b791 commit fc3b599
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/e2e/specs/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,39 +88,54 @@ describe('Settings', () => {

describe('VS Code, when updating the "Path to Radicle to Node Home" setting,', () => {
let pathToNodeHomeSetting: Setting
let outputView: OutputView

before(async () => {
pathToNodeHomeSetting = await settings.findSetting(
'Path To Node Home',
'Radicle',
'Advanced',
)
await workbench.executeCommand('Show Everything Logged in the Output Panel')
outputView = await workbench.getBottomBar().openOutputView()
})

after(async () => {
const searchBox = await getSettingsSearchBox(settings)
await clearInput(searchBox)
})

afterEach(async () => {
await outputView.clearText()
await clearTextSetting(pathToNodeHomeSetting)

await expectOutputToContain(outputView, 'Using already unsealed Radicle identity')
})

/**
* In Linux CI:
* - The extension is having issues resolving the correct node home directory (RAD_HOME).
* - Even when set explicitly in the settings, the extension incorrectly reports it as
* non-authenticated.
*/
it('logs an error in the output console if the path is invalid @skipLinuxCI', async () => {
await workbench.executeCommand('Show Everything Logged in the Output Panel')
const outputView = await workbench.getBottomBar().openOutputView()
await outputView.clearText()

await setTextSettingValue(pathToNodeHomeSetting, '/tmp')

await expectOutputToContain(outputView, '✗ Error: Radicle profile not found in')
})

it('recognizes when a valid path is specified @skipLinuxCI', async () => {
const tempNodeHomePath = `${nodeHomePath}.temp`
await $`cp -r ${nodeHomePath} ${tempNodeHomePath}`
await outputView.clearText()
await clearTextSetting(pathToNodeHomeSetting)

await setTextSettingValue(pathToNodeHomeSetting, tempNodeHomePath)

await expectOutputToContain(outputView, 'Using already unsealed Radicle identity')

await $`rm -rf ${tempNodeHomePath}`
})
})
})
Expand Down

0 comments on commit fc3b599

Please sign in to comment.