Skip to content

Commit fa8ddb3

Browse files
committed
integration test progress
1 parent b26b87f commit fa8ddb3

File tree

2 files changed

+1
-103
lines changed

2 files changed

+1
-103
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"integration": "run-s build test:integration",
1818
"test:unit": "mocha test/unit/*.spec.ts --require ts-node/register",
1919
"test:integration": "mocha test/integration/*.ts --slow 5000 --timeout 20000 --require ts-node/register",
20+
"test:integration:dataconnect": "npx mocha test/integration/data-connect.spec.ts --slow 5000 --timeout 20000 --require ts-node/register",
2021
"test:coverage": "nyc npm run test:unit",
2122
"lint:src": "eslint src/ --ext .ts",
2223
"lint:test": "eslint test/ --ext .ts",

test/integration/data-connect.spec.ts

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -387,107 +387,4 @@ describe('getDataConnect()', () => {
387387
});
388388
});
389389
});
390-
391-
// describe('impersonateQuery()', () => {
392-
// const impersonateConnectorConfig: ConnectorConfig = { ...connectorConfig, connector: 'my-connector' };
393-
// describe('with unauthenticated impersonation', () => {
394-
// const optsUnauthorizedClaims: GraphqlOptions<undefined> = {
395-
// impersonate: {
396-
// unauthenticated: true
397-
// }
398-
// };
399-
400-
// it('should successfully execute a query with @auth(level: PUBLIC)', () => {
401-
// return getDataConnect(impersonateConnectorConfig).impersonateQuery({})
402-
// .should.eventually.be.rejected.and.have.property('code', 'data-connect/permission-denied');
403-
404-
// });
405-
// it('should successfully execute a query with @auth(level: NO_ACCESS)', () => {});
406-
// it('should fail to successfully execute a query with @auth(level: USER)', () => {});
407-
// it('should fail to successfully execute a query with @auth(level: USER_ANON)', () => {});
408-
// it('should fail to successfully execute a query with @auth(level: USER_EMAIL_VERIFIED)', () => {});
409-
// });
410-
// describe('with authenticated impersonation', () => {
411-
// const optsAuthorizedClaims: GraphqlOptions<undefined> = {
412-
// impersonate: {
413-
// authClaims: {
414-
// sub: userId,
415-
// email_verified: true,
416-
// firebase: {
417-
// identities: { who: 'me' },
418-
// sign_in_provider: 'google.com'
419-
// }
420-
// }
421-
// }
422-
// };
423-
// const optsNonExistingClaims: GraphqlOptions<undefined> = {
424-
// impersonate: {
425-
// authClaims: {
426-
// sub: 'non-exisiting-id',
427-
// email_verified: true,
428-
// firebase: {
429-
// identities: { who: 'me' },
430-
// sign_in_provider: 'google.com'
431-
// }
432-
// }
433-
// }
434-
// };
435-
// const optsAnonymousClaims: GraphqlOptions<undefined> = {
436-
// impersonate: {
437-
// authClaims: {
438-
// sub: userId,
439-
// email_verified: true,
440-
// firebase: {
441-
// identities: { who: 'me' },
442-
// sign_in_provider: 'anonymous'
443-
// }
444-
// }
445-
// }
446-
// };
447-
// const optsUnverifiedClaims: GraphqlOptions<undefined> = {
448-
// impersonate: {
449-
// authClaims: {
450-
// sub: 'non-exisiting-id',
451-
// email_verified: false
452-
// }
453-
// }
454-
// };
455-
// it('should successfully execute a query with @auth(level: PUBLIC)', () => {});
456-
// it('should successfully execute a query with @auth(level: NO_ACCESS)', () => {});
457-
// it('should successfully execute a query with @auth(level: USER) \
458-
// if the impersonated user is not anonymous', () => {});
459-
// it('should fail to successfully execute a query with @auth(level: USER) \
460-
// if the impersonated user is anonymous', () => {});
461-
// it('should successfully execute a query with @auth(level: USER_ANON)', () => {});
462-
// it('should successfully execute a query with @auth(level: USER_EMAIL_VERIFIED) \
463-
// if the impersonated user has their email verified', () => {});
464-
// it('should fail to successfully execute a query with @auth(level: USER_EMAIL_VERIFIED) \
465-
// if the impersonated user does not have email verified', () => {});
466-
// it("should grab the impersonated user's data", () => {});
467-
// });
468-
// });
469-
470-
// describe('impersonateMutation()', () => {
471-
// describe('with unauthenticated impersonation', () => {
472-
// it('should successfully execute a mutation with @auth(level: PUBLIC)', () => {});
473-
// it('should successfully execute a mutation with @auth(level: NO_ACCESS)', () => {});
474-
// it('should fail to successfully execute a mutation with @auth(level: USER)', () => {});
475-
// it('should fail to successfully execute a mutation with @auth(level: USER_ANON)', () => {});
476-
// it('should fail to successfully execute a mutation with @auth(level: USER_EMAIL_VERIFIED)', () => {});
477-
// });
478-
// describe('with authenticated impersonation', () => {
479-
// it('should successfully execute a mutation with @auth(level: PUBLIC)', () => {});
480-
// it('should successfully execute a mutation with @auth(level: NO_ACCESS)', () => {});
481-
// it('should successfully execute a mutation with @auth(level: USER) \
482-
// if the impersonated user is not anonymous', () => {});
483-
// it('should fail to successfully execute a mutation with @auth(level: USER) \
484-
// if the impersonated user is anonymous', () => {});
485-
// it('should successfully execute a mutation with @auth(level: USER_ANON)', () => {});
486-
// it('should successfully execute a mutation with @auth(level: USER_EMAIL_VERIFIED) \
487-
// if the impersonated user has their email verified', () => {});
488-
// it('should fail to successfully execute a mutation with @auth(level: USER_EMAIL_VERIFIED) \
489-
// if the impersonated user does not have email verified', () => {});
490-
// it("should grab the impersonated user's data", () => {});
491-
// });
492-
// });
493390
});

0 commit comments

Comments
 (0)