test(YouTube Node): Add tests for YouTube Node (#14459)

Co-authored-by: Roman Davydchuk <roman.davydchuk@n8n.io>
This commit is contained in:
Shireen Missi
2025-04-14 10:05:05 +01:00
committed by GitHub
parent 6b2d31ca2b
commit e1246ab65c
12 changed files with 2117 additions and 1 deletions

View File

@@ -213,6 +213,25 @@ BQIDAQAB
expires_in: 86400,
},
},
youTubeOAuth2Api: {
grantType: 'authorizationCode',
authUrl: 'https://accounts.google.com/o/oauth2/v2/auth',
accessTokenUrl: 'https://oauth2.googleapis.com/token',
clientId: 'CLIENTID',
clientSecret: 'CLIENTSECRET',
scope:
'https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtubepartner-channel-audit',
authQueryParameters: 'access_type=offline&prompt=consent',
authentication: 'body',
oauthTokenData: {
access_token: 'ACCESSTOKEN',
refresh_token: 'REFRESHTOKEN',
scope:
'https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtubepartner-channel-audit',
token_type: 'bearer',
expires_in: 86400,
},
},
notionApi: {
apiKey: 'key123',
},

View File

@@ -98,7 +98,7 @@ export const equalityTest = async (testData: WorkflowTestData) => {
}
// Convert errors to JSON so tests can compare
if (json.error instanceof Error) {
if (json?.error instanceof Error) {
json.error = JSON.parse(
JSON.stringify(json.error, ['message', 'name', 'description', 'context']),
);