2021-04-12 15:53:12 +00:00
|
|
|
import { newResult, TestResult } from './utils'
|
|
|
|
|
2021-04-12 18:15:44 +00:00
|
|
|
export async function diagUri (test: string, { settingsManager }: RegisterServerOptions): Promise<TestResult> {
|
2021-04-12 15:53:12 +00:00
|
|
|
const result = newResult(test)
|
|
|
|
result.label = 'External Webchat using an iframe'
|
|
|
|
const settings = await settingsManager.getSettings([
|
|
|
|
'chat-uri'
|
|
|
|
])
|
|
|
|
if (/^https:\/\//.test(settings['chat-uri'] as string)) {
|
|
|
|
result.ok = true
|
2021-08-04 15:15:58 +00:00
|
|
|
result.messages.push('Chat url will be: ' + (settings['chat-uri'] as string))
|
2021-04-12 15:53:12 +00:00
|
|
|
} else {
|
|
|
|
result.messages.push('Incorrect value for the uri (it does not start with https://)')
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|