-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3ab1be
commit b23510b
Showing
15 changed files
with
448 additions
and
475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,26 @@ | ||
import { giteeRequest } from '../helper/helper'; | ||
import { mockGiteeUser } from '../mock/mock-gitee-user'; | ||
import { mockGiteeUser } from '../mock/mock-git-user'; | ||
|
||
describe('Test Fake Authenticate Gitee', () => { | ||
test('Test Authenticate Gitee', async () => { | ||
mockGiteeUser(); | ||
const res = await giteeRequest.authenticate(); | ||
expect(res).toEqual({ | ||
id: 1000001, | ||
login: '***', | ||
name: '***', | ||
avatar_url: 'https://foruda.gitee.com/avatar/***/***.png', | ||
url: 'https://gitee.com/api/v5/users/***', | ||
html_url: 'https://gitee.com/***', | ||
remark: '', | ||
followers_url: 'https://gitee.com/api/v5/users/***/followers', | ||
following_url: 'https://gitee.com/api/v5/users/***/following_url{/other_user}', | ||
gists_url: 'https://gitee.com/api/v5/users/***/gists{/gist_id}', | ||
starred_url: 'https://gitee.com/api/v5/users/***/starred{/owner}{/repo}', | ||
subscriptions_url: 'https://gitee.com/api/v5/users/***/subscriptions', | ||
organizations_url: 'https://gitee.com/api/v5/users/***/orgs', | ||
repos_url: 'https://gitee.com/api/v5/users/***/repos', | ||
events_url: 'https://gitee.com/api/v5/users/***/events{/privacy}', | ||
received_events_url: 'https://gitee.com/api/v5/users/***/received_events', | ||
type: 'User', | ||
blog: null, | ||
weibo: null, | ||
bio: '', | ||
public_repos: 0, | ||
public_gists: 0, | ||
followers: 0, | ||
following: 0, | ||
stared: 0, | ||
watched: 0, | ||
created_at: '2020-02-26T13:20:27+08:00', | ||
updated_at: '2024-01-10T22:27:59+08:00', | ||
email: null | ||
}); | ||
expect(Object.keys(res)).toEqual([ | ||
'id', 'login', | ||
'name', 'avatar_url', | ||
'url', 'html_url', | ||
'remark', 'followers_url', | ||
'following_url', 'gists_url', | ||
'starred_url', 'subscriptions_url', | ||
'organizations_url', 'repos_url', | ||
'events_url', 'received_events_url', | ||
'type', 'blog', | ||
'weibo', 'bio', | ||
'public_repos', 'public_gists', | ||
'followers', 'following', | ||
'stared', 'watched', | ||
'created_at', 'updated_at', | ||
'email' | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,27 @@ | ||
import { githubRequest } from "../helper/helper"; | ||
import { mockGithubUser } from "../mock/mock-github-user"; | ||
import { mockGithubUser } from "../mock/mock-git-user"; | ||
|
||
describe('Test Fake Authenticate Github', () => { | ||
test('Test Authenticate Github', async () => { | ||
mockGithubUser(); | ||
const res = await githubRequest.authenticate(); | ||
expect(res).toEqual({ | ||
login: '***', | ||
id: 1000001, | ||
node_id: '***', | ||
avatar_url: 'https://avatars.githubusercontent.com/u/***?v=4', | ||
gravatar_id: '', | ||
url: 'https://api.github.com/users/***', | ||
html_url: 'https://github.com/***', | ||
followers_url: 'https://api.github.com/users/***/followers', | ||
following_url: 'https://api.github.com/users/***/following{/other_user}', | ||
gists_url: 'https://api.github.com/users/***/gists{/gist_id}', | ||
starred_url: 'https://api.github.com/users/***/starred{/owner}{/repo}', | ||
subscriptions_url: 'https://api.github.com/users/***/subscriptions', | ||
organizations_url: 'https://api.github.com/users/***/orgs', | ||
repos_url: 'https://api.github.com/users/***/repos', | ||
events_url: 'https://api.github.com/users/***/events{/privacy}', | ||
received_events_url: 'https://api.github.com/users/***/received_events', | ||
type: 'User', | ||
site_admin: false, | ||
name: '***', | ||
company: null, | ||
blog: '***.github.io', | ||
location: '***', | ||
email: null, | ||
hireable: null, | ||
bio: '***', | ||
twitter_username: null, | ||
public_repos: 0, | ||
public_gists: 0, | ||
followers: 0, | ||
following: 0, | ||
created_at: '2017-12-04T12:29:35Z', | ||
updated_at: '2023-12-17T04:01:22Z' | ||
}); | ||
expect(Object.keys(res)).toEqual([ | ||
'login', 'id', | ||
'node_id', 'avatar_url', | ||
'gravatar_id', 'url', | ||
'html_url', 'followers_url', | ||
'following_url', 'gists_url', | ||
'starred_url', 'subscriptions_url', | ||
'organizations_url', 'repos_url', | ||
'events_url', 'received_events_url', | ||
'type', 'site_admin', | ||
'name', 'company', | ||
'blog', 'location', | ||
'email', 'hireable', | ||
'bio', 'twitter_username', | ||
'public_repos', 'public_gists', | ||
'followers', 'following', | ||
'created_at', 'updated_at' | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
import { gitlabRequest } from "../helper/helper"; | ||
import { mockGitlabUser } from "../mock/mock-gitlab-user"; | ||
import { mockGitlabUser } from "../mock/mock-git-user"; | ||
|
||
describe('Test Fake Authenticate Gitlab', () => { | ||
test('Test Authenticate Gitlab', async () => { | ||
mockGitlabUser(); | ||
const res = await gitlabRequest.authenticate(); | ||
expect(res).toEqual({ | ||
id: 100001, | ||
username: '***', | ||
name: '***', | ||
state: 'active', | ||
locked: false, | ||
avatar_url: 'https://secure.gravatar.com/avatar/***?s=80&d=identicon', | ||
web_url: 'https://gitlab.com/***', | ||
created_at: '2023-12-21T02:56:43.269Z', | ||
bio: '', | ||
location: '', | ||
public_email: null, | ||
skype: '', | ||
linkedin: '', | ||
twitter: '', | ||
discord: '', | ||
website_url: '', | ||
organization: '', | ||
job_title: '', | ||
pronouns: null, | ||
bot: true, | ||
work_information: null, | ||
local_time: null, | ||
last_sign_in_at: null, | ||
confirmed_at: '2023-12-21T02:56:43.230Z', | ||
last_activity_on: '2024-01-12', | ||
email: '***@noreply.gitlab.com', | ||
theme_id: 0, | ||
color_scheme_id: 0, | ||
projects_limit: 0, | ||
current_sign_in_at: null, | ||
identities: [], | ||
can_create_group: true, | ||
can_create_project: true, | ||
two_factor_enabled: false, | ||
external: false, | ||
private_profile: false, | ||
commit_email: '***@noreply.gitlab.com', | ||
shared_runners_minutes_limit: null, | ||
extra_shared_runners_minutes_limit: null, | ||
scim_identities: [] | ||
}); | ||
expect(Object.keys(res)).toEqual([ | ||
'id', | ||
'username', | ||
'name', | ||
'state', | ||
'locked', | ||
'avatar_url', | ||
'web_url', | ||
'created_at', | ||
'bio', | ||
'location', | ||
'public_email', | ||
'skype', | ||
'linkedin', | ||
'twitter', | ||
'discord', | ||
'website_url', | ||
'organization', | ||
'job_title', | ||
'pronouns', | ||
'bot', | ||
'work_information', | ||
'local_time', | ||
'last_sign_in_at', | ||
'confirmed_at', | ||
'last_activity_on', | ||
'email', | ||
'theme_id', | ||
'color_scheme_id', | ||
'projects_limit', | ||
'current_sign_in_at', | ||
'identities', | ||
'can_create_group', | ||
'can_create_project', | ||
'two_factor_enabled', | ||
'external', | ||
'private_profile', | ||
'commit_email', | ||
'shared_runners_minutes_limit', | ||
'extra_shared_runners_minutes_limit', | ||
'scim_identities' | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.