mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
test: add test for invalid cookie url (#19568)
This commit is contained in:
committed by
Samuel Attard
parent
5614ae4241
commit
f2f483fedb
@@ -145,6 +145,16 @@ describe('session module', () => {
|
||||
expect(error).to.have.property('message').which.equals('Failed to get cookie domain')
|
||||
})
|
||||
|
||||
it('yields an error when setting a cookie with an invalid URL', async () => {
|
||||
const { cookies } = session.defaultSession
|
||||
const name = '1'
|
||||
const value = '1'
|
||||
|
||||
await expect(
|
||||
cookies.set({ url: 'asdf', name, value })
|
||||
).to.eventually.be.rejectedWith('Failed to get cookie domain')
|
||||
})
|
||||
|
||||
it('should overwrite previous cookies', async () => {
|
||||
let error
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user