import { Session, Uri } from '../../utils' describe('URI', () => { it('should be defined', () => { expect(Uri).toBeDefined() }) it('should create a new instance', () => { const uri = new Uri({ session: new Session({ env: 'production', type: 'OAuth' }), }) expect(uri).toBeDefined() }) describe('baseUrl', () => { describe('planning center', () => { it('should return the correct base URL for production', () => { const uri = new Uri({ session: new Session({ env: 'production', type: 'OAuth' }), }) expect(uri.baseUrl).toBe('https://api.planningcenteronline.com') }) it('should return the correct base URL for staging', () => { const uri = new Uri({ session: new Session({ env: 'staging', type: 'OAuth' }), }) expect(uri.baseUrl).toBe('https://api-staging.planningcenteronline.com') }) it('should return the correct base URL for development', () => { const uri = new Uri({ session: new Session({ env: 'development', type: 'OAuth' }), }) expect(uri.baseUrl).toBe('https://api.pco.test') }) }) describe('church center', () => { it('should return the correct base URL for production', () => { const uri = new Uri({ session: new Session({ env: 'production', type: 'ChurchCenterOauth' }), graph: 'churchcenter', }) expect(uri.baseUrl).toBe('https://api.churchcenter.com') }) it('should return the correct base URL for staging', () => { const uri = new Uri({ session: new Session({ env: 'staging', type: 'ChurchCenterOauth' }), graph: 'churchcenter', }) expect(uri.baseUrl).toBe('https://api.staging.churchcenter.com') }) it('should return the correct base URL for development', () => { const uri = new Uri({ session: new Session({ env: 'development', type: 'ChurchCenterOauth' }), graph: 'churchcenter', }) expect(uri.baseUrl).toBe('https://api.churchcenter.test') }) }) }) })