@@ -11,11 +11,11 @@ describe(CertificateAndKeyManagement.name, function () {
1111 pluginCertificateManagement = new CertificateAndKeyManagement ( global . bf ) ;
1212 } ) ;
1313
14- const configGeneratedCert = {
14+ const configCreatedCert = {
1515 certificates : [
1616 {
17- name : 'identity_provider ' ,
18- label : 'identity_provider ' ,
17+ name : 'foo ' ,
18+ label : 'foo ' ,
1919 } ,
2020 ] ,
2121 } ;
@@ -35,11 +35,11 @@ describe(CertificateAndKeyManagement.name, function () {
3535 assert . deepStrictEqual ( sourceDeployCmd . status , 0 , sourceDeployCmd . output . toString ( ) ) ;
3636 } ) ;
3737 it ( 'should create a self-signed certificate' , async ( ) => {
38- await pluginCertificateManagement . apply ( configGeneratedCert ) ;
38+ await pluginCertificateManagement . apply ( configCreatedCert ) ;
3939 } ) ;
4040 it ( 'should not do anything if self-signed certificate is already available' , async ( ) => {
4141 // explictly pass definition to retrieve
42- const res = await pluginCertificateManagement . run ( configGeneratedCert ) ;
42+ const res = await pluginCertificateManagement . run ( configCreatedCert ) ;
4343 assert . deepStrictEqual ( res , { message : 'no action necessary' } ) ;
4444 } ) ;
4545 it ( 'should import a cert from a keystore' , async ( ) => {
@@ -49,9 +49,15 @@ describe(CertificateAndKeyManagement.name, function () {
4949 const res = await pluginCertificateManagement . run ( configImportFromKeystore ) ;
5050 assert . deepStrictEqual ( res , { message : 'no action necessary' } ) ;
5151 } ) ;
52+ it ( 'should disable Identity Provider' , async ( ) => {
53+ const __dirname = fileURLToPath ( new URL ( '.' , import . meta. url ) ) ;
54+ const dir = resolve ( join ( __dirname , 'sfdx-source' , 'disable-identity-provider' ) ) ;
55+ const sourceDeployCmd = spawnSync ( 'sf' , [ 'project' , 'deploy' , 'start' , '-d' , dir , '--json' ] ) ;
56+ assert . deepStrictEqual ( sourceDeployCmd . status , 0 , sourceDeployCmd . output . toString ( ) ) ;
57+ } ) ;
5258 it ( 'should delete certificates using Metadata API' , async ( ) => {
5359 const org = await Org . create ( { } ) ;
5460 const conn = org . getConnection ( ) ;
55- await conn . metadata . delete ( 'Certificate' , [ 'identity_provider' , 'Dummy' ] ) ;
61+ await conn . metadata . delete ( 'Certificate' , [ 'identity_provider' , 'foo' , ' Dummy'] ) ;
5662 } ) ;
5763} ) ;
0 commit comments