Add assertions for new fields in existing specs.

This commit is contained in:
Greg Nolle 2016-11-11 09:55:56 +00:00 committed by Kevin Sawicki
parent 5d028f9163
commit 93ce2f7800
2 changed files with 16 additions and 0 deletions

View file

@ -207,6 +207,14 @@ describe('app module', function () {
app.on('select-client-certificate', function (event, webContents, url, list, callback) { app.on('select-client-certificate', function (event, webContents, url, list, callback) {
assert.equal(list.length, 1) assert.equal(list.length, 1)
assert.equal(list[0].issuerName, 'Intermediate CA') assert.equal(list[0].issuerName, 'Intermediate CA')
assert.equal(list[0].subjectName, 'localhost')
assert(list[0].issuer);
assert.equal(list[0].issuer.commonName, 'Intermediate CA')
assert(list[0].subject);
assert.equal(list[0].subject.commonName, 'localhost')
assert(list[0].issuerCert)
assert(list[0].issuerCert.subject)
assert.equal(list[0].issuerCert.subject.commonName, 'Intermediate CA')
callback(list[0]) callback(list[0])
}) })

View file

@ -553,6 +553,14 @@ describe('session module', function () {
session.defaultSession.setCertificateVerifyProc(function (hostname, certificate, callback) { session.defaultSession.setCertificateVerifyProc(function (hostname, certificate, callback) {
assert.equal(hostname, '127.0.0.1') assert.equal(hostname, '127.0.0.1')
assert.equal(certificate.issuerName, 'Intermediate CA') assert.equal(certificate.issuerName, 'Intermediate CA')
assert.equal(certificate.subjectName, 'localhost')
assert(certificate.issuer);
assert.equal(certificate.issuer.commonName, 'Intermediate CA')
assert(certificate.subject);
assert.equal(certificate.subject.commonName, 'localhost')
assert(certificate.issuerCert)
assert(certificate.issuerCert.subject)
assert.equal(certificate.issuerCert.subject.commonName, 'Intermediate CA')
callback(false) callback(false)
}) })