1
0
Fork 0
mirror of synced 2024-07-14 18:55:45 +12:00

PR comments

This commit is contained in:
Martin McKeaveney 2023-03-06 10:33:49 +00:00
parent edac525424
commit 26660b12fb
3 changed files with 12 additions and 1 deletions

View file

@ -179,7 +179,7 @@ export async function getGoogleDatasourceConfig(): Promise<
} }
export function getDefaultGoogleConfig(): GoogleInnerConfig | undefined { export function getDefaultGoogleConfig(): GoogleInnerConfig | undefined {
if (env.isTest() || (environment.GOOGLE_CLIENT_ID && environment.GOOGLE_CLIENT_SECRET)) { if (environment.GOOGLE_CLIENT_ID && environment.GOOGLE_CLIENT_SECRET) {
return { return {
clientID: environment.GOOGLE_CLIENT_ID!, clientID: environment.GOOGLE_CLIENT_ID!,
clientSecret: environment.GOOGLE_CLIENT_SECRET!, clientSecret: environment.GOOGLE_CLIENT_SECRET!,

View file

@ -35,6 +35,10 @@ describe("Google Sheets Integration", () => {
let integration: any, let integration: any,
config = new TestConfiguration() config = new TestConfiguration()
beforeAll(() => {
config.setGoogleAuth("test")
})
beforeEach(async () => { beforeEach(async () => {
integration = new GoogleSheetsIntegration.integration({ integration = new GoogleSheetsIntegration.integration({
spreadsheetId: "randomId", spreadsheetId: "randomId",

View file

@ -181,6 +181,13 @@ class TestConfiguration {
coreEnv._set("SELF_HOSTED", value) coreEnv._set("SELF_HOSTED", value)
} }
setGoogleAuth = (value: string) => {
env._set("GOOGLE_CLIENT_ID", value)
env._set("GOOGLE_CLIENT_SECRET", value)
coreEnv._set("GOOGLE_CLIENT_ID", value)
coreEnv._set("GOOGLE_CLIENT_SECRET", value)
}
modeCloud = () => { modeCloud = () => {
this.setSelfHosted(false) this.setSelfHosted(false)
} }