@@ -556,12 +556,15 @@ describe('providers/nodebb', () => {
556
556
data . config . core . forum = url ;
557
557
data . useragent = agent ;
558
558
return forum . connectWebsocket ( ) . then ( ( ) => {
559
- Forum . io . calledWith ( url , {
560
- extraHeaders : {
561
- 'User-Agent' : agent ,
562
- 'Cookie' : cookies
559
+ Forum . io . firstCall . args . should . deep . eql ( [
560
+ url , {
561
+ extraHeaders : {
562
+ 'Origin' : url ,
563
+ 'User-Agent' : agent ,
564
+ 'Cookie' : cookies
565
+ }
563
566
}
564
- } ) . should . be . true ;
567
+ ] ) ;
565
568
} ) ;
566
569
} ) ;
567
570
it ( 'should register for websocket `pong` event' , ( ) => {
@@ -870,16 +873,16 @@ describe('providers/nodebb', () => {
870
873
sandbox . stub ( forum . Chat , 'deactivate' ) ;
871
874
} ) ;
872
875
afterEach ( ( ) => sandbox . restore ( ) ) ;
873
-
876
+
874
877
it ( 'must expose a method named supports' , ( ) => {
875
878
forum . supports . should . be . a ( 'function' ) ;
876
879
} ) ;
877
-
880
+
878
881
it ( 'must return false if a capability is unsupported' , ( ) => {
879
882
forum . supports ( 'Jack' ) . should . be . false ;
880
883
forum . supports ( 'PMs' ) . should . be . false ;
881
884
} ) ;
882
-
885
+
883
886
it ( 'must return true if a capability is supported' , ( ) => {
884
887
forum . supports ( 'PrivateMessage' ) . should . be . true ;
885
888
forum . supports ( 'Users' ) . should . be . true ;
@@ -889,20 +892,20 @@ describe('providers/nodebb', () => {
889
892
forum . supports ( 'Notifications' ) . should . be . true ;
890
893
forum . supports ( 'Formatting' ) . should . be . true ;
891
894
} ) ;
892
-
895
+
893
896
it ( 'must return false if a sub-capability is not supported' , ( ) => {
894
897
forum . supports ( 'Jack.Skellington' ) . should . be . false ;
895
898
forum . supports ( 'Chats.WithJackSkellington' ) . should . be . false ;
896
899
} ) ;
897
-
900
+
898
901
it ( 'must return true if a sub-capability is supported' , ( ) => {
899
902
forum . supports ( 'Users.Avatars' ) . should . be . true ;
900
903
} ) ;
901
-
904
+
902
905
it ( 'should return true if all items in an array are supported' , ( ) => {
903
906
forum . supports ( [ 'Users' , 'PrivateMessage' ] ) . should . be . true ;
904
907
} ) ;
905
-
908
+
906
909
it ( 'must return false if any items in an array are not supported' , ( ) => {
907
910
forum . supports ( [ 'Users' , 'PrivateMessage' , 'Halloween' ] ) . should . be . false ;
908
911
} ) ;
0 commit comments