@@ -876,6 +876,108 @@ describe('ReportPortal javascript client', () => {
876876 } ) ;
877877 } ) ;
878878
879+ it ( 'should automatically add NOT_ISSUE when status is SKIPPED and skippedIsNotIssue is true' , function ( done ) {
880+ const mockClient = new RPClient (
881+ {
882+ apiKey : 'test' ,
883+ endpoint : 'https://reportportal-stub-url' ,
884+ launch : 'test launch' ,
885+ project : 'test project' ,
886+ skippedIsNotIssue : true ,
887+ } ,
888+ { name : 'test' , version : '1.0.0' } ,
889+ ) ;
890+
891+ const spyFinishTestItemPromiseStart = jest
892+ . spyOn ( mockClient , 'finishTestItemPromiseStart' )
893+ . mockImplementation ( ( ) => { } ) ;
894+
895+ mockClient . map = {
896+ testItemId : {
897+ children : [ ] ,
898+ finishSend : false ,
899+ promiseFinish : Promise . resolve ( ) ,
900+ resolveFinish : ( ) => { } ,
901+ } ,
902+ } ;
903+
904+ const finishTestItemRQ = {
905+ status : 'skipped' ,
906+ } ;
907+
908+ mockClient . finishTestItem ( 'testItemId' , finishTestItemRQ ) ;
909+
910+ setTimeout ( ( ) => {
911+ try {
912+ expect ( spyFinishTestItemPromiseStart ) . toHaveBeenCalledWith (
913+ expect . any ( Object ) ,
914+ 'testItemId' ,
915+ expect . objectContaining ( {
916+ status : 'skipped' ,
917+ issue : { issueType : 'NOT_ISSUE' } ,
918+ } ) ,
919+ ) ;
920+ done ( ) ;
921+ } catch ( error ) {
922+ done ( error ) ;
923+ }
924+ } , 50 ) ;
925+ } ) ;
926+
927+ it ( 'should not add NOT_ISSUE when status is SKIPPED and skippedIsNotIssue is false' , function ( done ) {
928+ const mockClient = new RPClient (
929+ {
930+ apiKey : 'test' ,
931+ endpoint : 'https://reportportal-stub-url' ,
932+ launch : 'test launch' ,
933+ project : 'test project' ,
934+ skippedIsNotIssue : false ,
935+ } ,
936+ { name : 'test' , version : '1.0.0' } ,
937+ ) ;
938+
939+ const spyFinishTestItemPromiseStart = jest
940+ . spyOn ( mockClient , 'finishTestItemPromiseStart' )
941+ . mockImplementation ( ( ) => { } ) ;
942+
943+ mockClient . map = {
944+ testItemId : {
945+ children : [ ] ,
946+ finishSend : false ,
947+ promiseFinish : Promise . resolve ( ) ,
948+ resolveFinish : ( ) => { } ,
949+ } ,
950+ } ;
951+
952+ const finishTestItemRQ = {
953+ status : 'skipped' ,
954+ } ;
955+
956+ mockClient . finishTestItem ( 'testItemId' , finishTestItemRQ ) ;
957+
958+ setTimeout ( ( ) => {
959+ try {
960+ expect ( spyFinishTestItemPromiseStart ) . toHaveBeenCalledWith (
961+ expect . any ( Object ) ,
962+ 'testItemId' ,
963+ expect . objectContaining ( {
964+ status : 'skipped' ,
965+ } ) ,
966+ ) ;
967+ expect ( spyFinishTestItemPromiseStart ) . not . toHaveBeenCalledWith (
968+ expect . any ( Object ) ,
969+ 'testItemId' ,
970+ expect . objectContaining ( {
971+ issue : expect . anything ( ) ,
972+ } ) ,
973+ ) ;
974+ done ( ) ;
975+ } catch ( error ) {
976+ done ( error ) ;
977+ }
978+ } , 100 ) ;
979+ } ) ;
980+
879981 describe ( 'saveLog' , ( ) => {
880982 it ( 'should return object with tempId and promise' , ( ) => {
881983 const client = new RPClient ( { apiKey : 'any' , endpoint : 'https://rp.api' , project : 'prj' } ) ;
0 commit comments