11시 오전 회의 주제: 퍼블 디자인 개발 프로세스 공유 전역 스타일 모듈 스타일 () 섹션&페이지 스타일 (로그인, 그룹 등록...) 인라인 스타일 (독립적인 컴포넌트) 제플린과 연동한 작업에 관한 상의 page section 단위 section 컴포넌트 단위 component 기능 단위 import { of } from 'rxjs'; import { TestBed } from '@angular/core/testing'; import { DeviceType, LocaleCode } from '@ucap/core'; import { ProtocolMessage } from '@ucap/protocol'; import { LogService } from '@ucap/ng-logger'; import { ProtocolService } from '@ucap/ng-protocol'; import { LoginRequest, SSOMode, SVC_TYPE_LOGIN, SSVC_TYPE_LOGIN_REQ, LogoutRequest, SSVC_TYPE_LOGOUT_RES, SSVC_TYPE_LOGIN_RES } from '@ucap/protocol-authentication'; import { AuthenticationProtocolService } from './authentication-protocol.service'; import { _MODULE_CONFIG } from '../config/token'; describe('AuthenticationProtocolService', () => { const senderSeq = '10045'; let service: AuthenticationProtocolService; let protocolServiceSpy: jasmine.SpyObj; beforeEach(() => { const spyProtocolService = { ...jasmine.createSpyObj('ProtocolService', ['connect', 'call']), serverMessage$: of() }; TestBed.configureTestingModule({ providers: [ AuthenticationProtocolService, { provide: _MODULE_CONFIG, useValue: _MODULE_CONFIG }, { provide: ProtocolService, useValue: spyProtocolService }, { provide: LogService, useValue: LogService } ] }); service = TestBed.inject(AuthenticationProtocolService); protocolServiceSpy = TestBed.inject(ProtocolService) as jasmine.SpyObj< ProtocolService >; }); it('should be created', () => { expect(service).toBeTruthy(); }); it('Test Login', (done) => { protocolServiceSpy.call.and.returnValue( of({ serviceType: SVC_TYPE_LOGIN, subServiceType: SSVC_TYPE_LOGIN_RES, senderSeq, bodyList: [ 'test03', '9826', '9826테스트3https://dstalk.daesang.com/Extern/StreamProfileUrl.aspx?p_empno=ZZZZZZZ3사업부장하지마GUC10001090882377 01224646@daesang.com식자재사업부A330ZZZZZZZ3Test3Test3manager_enmanager_cn식자재사업부식자재사업부P ', ' 2 0', 'GUC100', '205', 'test03', '1', '', 'N', '0', '1', '회의중', '테스트중', 'GUC100', '30', '90', 'Y', '', '', '', '0', 'Y', 'Y', 'Y', 'Y', 'Y', 'stubTokenString', 'N', '4', '6', ' ', 'Y', '2' ] }) ); const req = { loginId: '', loginPw: '', deviceType: DeviceType.PC, deviceId: '', token: '', localeCode: LocaleCode.Korean, pushId: '', companyCode: '', passwordEncodingType: 0, clientVersion: '', reconnect: false, ip: '', hostName: '', ssoMode: SSOMode.NONE, userSpecificInformation: '', andId: '', andPushRefreshYn: '' } as LoginRequest; // service.login(req)..returnValue(); service.login(req).subscribe((res) => { // console.log(res); expect(res).toBeDefined(); expect(res.companyCode).toBe('GUC100'); expect(res.userInfo.seq).toBeDefined(); done(); }); }); it('Test Logout', (done) => { protocolServiceSpy.call.and.returnValue( of({ serviceType: SVC_TYPE_LOGIN, subServiceType: SSVC_TYPE_LOGOUT_RES, senderSeq, bodyList: ['99'] }) ); const req = {} as LogoutRequest; service.logout(req).subscribe((res) => { // console.log(res); expect(res).toBeDefined(); expect(res.reasonCode).toBe(99); done(); }); }); });