feat: allow setting of global fallback user agent (#18016)
* feat: allow setting of global fallback user agent * spec: add tests for app.set/getUserAgentFallback
This commit is contained in:
parent
649d7c0d9e
commit
d4f5ebefe6
9 changed files with 63 additions and 5 deletions
|
@ -1296,6 +1296,30 @@ describe('default behavior', () => {
|
|||
expect(result).to.equal(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('user agent fallback', () => {
|
||||
let initialValue: string
|
||||
|
||||
before(() => {
|
||||
initialValue = app.userAgentFallback!
|
||||
})
|
||||
|
||||
it('should have a reasonable default', () => {
|
||||
expect(initialValue).to.include(`Electron/${process.versions.electron}`)
|
||||
expect(initialValue).to.include(`Chrome/${process.versions.chrome}`)
|
||||
})
|
||||
|
||||
it('should be overridable', () => {
|
||||
app.userAgentFallback = 'test-agent/123'
|
||||
expect(app.userAgentFallback).to.equal('test-agent/123')
|
||||
})
|
||||
|
||||
it('should be restorable', () => {
|
||||
app.userAgentFallback = 'test-agent/123'
|
||||
app.userAgentFallback = ''
|
||||
expect(app.userAgentFallback).to.equal(initialValue)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
async function runTestApp (name: string, ...args: any[]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue