File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -709,7 +709,6 @@ describe("lib/mailtrap-client: ", () => {
709
709
it ( "rejects with Mailtrap error, when `accountId` is missing." , ( ) => {
710
710
const client = new MailtrapClient ( {
711
711
token : "MY_API_TOKEN" ,
712
- testInboxId : 5 ,
713
712
} ) ;
714
713
715
714
expect . assertions ( 1 ) ;
@@ -721,11 +720,21 @@ describe("lib/mailtrap-client: ", () => {
721
720
}
722
721
} ) ;
723
722
723
+ it ( "returns testing API object when accountId is provided, even without testInboxId" , ( ) => {
724
+ const client = new MailtrapClient ( {
725
+ token : "MY_API_TOKEN" ,
726
+ accountId : 123 ,
727
+ // testInboxId is intentionally omitted
728
+ } ) ;
729
+ expect . assertions ( 1 ) ;
730
+
731
+ const testingClient = client . testing ;
732
+ expect ( testingClient ) . toBeInstanceOf ( TestingAPI ) ;
733
+ } ) ;
734
+
724
735
it ( "returns testing API object, console warn is called twice." , ( ) => {
725
736
const client = new MailtrapClient ( {
726
737
token : "MY_API_TOKEN" ,
727
- sandbox : true ,
728
- testInboxId : 10 ,
729
738
accountId : 10 ,
730
739
} ) ;
731
740
expect . assertions ( 1 ) ;
You can’t perform that action at this time.
0 commit comments