@@ -12,6 +12,7 @@ const expect = chai.expect
1212const serverUri = 'https://example.com'
1313
1414const sampleProfileSrc = require ( '../resources/sample-webid-profile' )
15+ const sampleProfileSrcWithOidcIssuer = require ( '../resources/sample-webid-profile-with-oidc-issuer' )
1516
1617describe ( 'preferred-provider.js' , ( ) => {
1718 afterEach ( ( ) => {
@@ -22,6 +23,10 @@ describe('preferred-provider.js', () => {
2223 const webId = 'https://example.com/#me'
2324
2425 it ( 'should extract and validate the provider uri from link rel header' , ( ) => {
26+ nock ( 'https://example.com' )
27+ . get ( '/' )
28+ . reply ( 200 , sampleProfileSrc )
29+
2530 nock ( serverUri )
2631 . options ( '/' )
2732 . reply ( 204 , 'No content' , {
@@ -35,6 +40,10 @@ describe('preferred-provider.js', () => {
3540 } )
3641
3742 it ( 'should not drop the path from extracted provider uri' , ( ) => {
43+ nock ( 'https://example.com' )
44+ . get ( '/' )
45+ . reply ( 200 , sampleProfileSrc )
46+
3847 nock ( serverUri )
3948 . options ( '/' )
4049 . reply ( 204 , 'No content' , {
@@ -48,13 +57,9 @@ describe('preferred-provider.js', () => {
4857 } )
4958
5059 it ( 'should extract and validate the provider uri from the webid profile' , ( ) => {
51- nock ( serverUri )
52- . options ( '/' )
53- . reply ( 204 , 'No content' )
54-
5560 nock ( serverUri )
5661 . get ( '/' )
57- . reply ( 200 , sampleProfileSrc , {
62+ . reply ( 200 , sampleProfileSrcWithOidcIssuer , {
5863 'Content-Type' : 'text/turtle'
5964 } )
6065
@@ -147,6 +152,10 @@ describe('preferred-provider.js', () => {
147152 } )
148153
149154 it ( 'should discover preferred provider if no oidc capability at webid' , ( ) => {
155+ nock ( 'https://example.com' )
156+ . get ( '/profile' )
157+ . reply ( 200 , sampleProfileSrc )
158+
150159 nock ( 'https://example.com' )
151160 . head ( '/.well-known/openid-configuration' )
152161 . reply ( 404 )
0 commit comments