-
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.
Merge pull request #6 from Factorialers/develop
[ENHANCEMENT] ユーザー認証・認可を実装
- Loading branch information
Showing
47 changed files
with
1,636 additions
and
275 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Publish Graph to Develop' | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
publish-graph: | ||
name: Publish Graph | ||
runs-on: ubuntu-latest | ||
env: | ||
APOLLO_KEY: ${{secrets.APOLLO_KEY}} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Publish Graph | ||
run: yarn apollo:rover:develop |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import FirebaseService from '../../libs/firebase/firebase.service'; | ||
import { mock, MockedType } from '../../test/mock'; | ||
import UserMutation from './user.resolver.mutation'; | ||
import UserService from './user.service'; | ||
|
||
describe('User Mutation Resolver Test', () => { | ||
let mockedFirebaseService: MockedType<FirebaseService>; | ||
let mockedUserService: MockedType<UserService>; | ||
let userQuery: UserMutation; | ||
|
||
beforeEach(() => { | ||
mockedFirebaseService = mock<FirebaseService>(); | ||
mockedUserService = mock<UserService>(); | ||
userQuery = new UserMutation(mockedFirebaseService, mockedUserService); | ||
}); | ||
|
||
test('createUser', async () => { | ||
const fakeUser = { | ||
id: 'abc-123', | ||
name: 'yukarisan-lover', | ||
createdAt: new Date(), | ||
}; | ||
mockedUserService.create.mockResolvedValue(fakeUser); | ||
|
||
const expectUser = fakeUser; | ||
await expect(userQuery.createUser({ data: { id: expectUser.id, name: expectUser.name } })).resolves.toEqual(expectUser); | ||
}); | ||
|
||
test('updateUser', async () => { | ||
const fakeUser = { | ||
id: 'abc-123', | ||
name: 'yukarisan-lover', | ||
createdAt: new Date(), | ||
}; | ||
mockedUserService.update.mockResolvedValue(fakeUser); | ||
|
||
const expectUser = fakeUser; | ||
await expect(userQuery.updateUser({ where: { id: expectUser.id }, data: { id: expectUser.id, name: expectUser.name } })).resolves.toEqual( | ||
expectUser, | ||
); | ||
}); | ||
|
||
test('deleteUser', async () => { | ||
const fakeUser = { | ||
id: 'abc-123', | ||
name: 'yukarisan-lover', | ||
createdAt: new Date(), | ||
}; | ||
mockedUserService.delete.mockResolvedValue(fakeUser); | ||
|
||
const expectUser = fakeUser; | ||
await expect(userQuery.deleteUser({ where: { id: expectUser.id } })).resolves.toEqual(expectUser); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { mock, MockedType } from '../../test/mock'; | ||
import UserQuery from './user.resolver.query'; | ||
import UserService from './user.service'; | ||
|
||
describe('User Query Resolver Test', () => { | ||
let mockedUserService: MockedType<UserService>; | ||
let userQuery: UserQuery; | ||
|
||
beforeEach(() => { | ||
mockedUserService = mock<UserService>(); | ||
userQuery = new UserQuery(mockedUserService); | ||
}); | ||
|
||
test('findUserById', async () => { | ||
const fakeUser = { | ||
id: 'abc-123', | ||
name: 'yukarisan-lover', | ||
createdAt: new Date(), | ||
}; | ||
mockedUserService.findUser.mockResolvedValue(fakeUser); | ||
|
||
const expectUser = fakeUser; | ||
await expect(userQuery.findUserById({ where: { id: expectUser.id } })).resolves.toEqual(expectUser); | ||
}); | ||
|
||
test('findUsers', async () => { | ||
const fakeUsers = [ | ||
{ | ||
id: 'abc-123', | ||
name: 'yukarisan-lover', | ||
createdAt: new Date(), | ||
}, | ||
{ | ||
id: 'abc-124', | ||
name: 'mikusan-lover', | ||
createdAt: new Date(), | ||
}, | ||
]; | ||
mockedUserService.findUsers.mockResolvedValue(fakeUsers); | ||
|
||
const expectUsers = fakeUsers; | ||
await expect( | ||
userQuery.findUsers({ | ||
where: { | ||
AND: expectUsers.map((user) => ({ | ||
name: { | ||
equals: user.name, | ||
}, | ||
})), | ||
}, | ||
}), | ||
).resolves.toEqual(expectUsers); | ||
}); | ||
}); |
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.