@@ -69,41 +69,35 @@ void main() {
6969 client = _StubParseClient ();
7070 });
7171
72- test (
73- 'attaches X-Parse-Installation-Id by default. Matches iOS '
74- 'PFURLSessionCommandRunner behaviour — every request carries the '
75- 'install ID so parse-server can bind created _Session rows to the '
76- 'right installation and so destroyDuplicatedSessions can clean up '
77- 'prior sessions on the same install during login' ,
78- () async {
79- final Map <String , String >? headers = await client.exposedBuildHeaders (
80- null ,
81- );
82-
83- expect (headers, isNotNull);
84- expect (headers! [keyHeaderInstallationId], isNotEmpty);
85- },
86- );
87-
88- test (
89- 'omits X-Parse-Installation-Id when caller passes '
90- 'sendInstallationId: false. The opt-out is forwarded by methods such '
91- 'as ParseUser.signUp(doNotSendInstallationID: true) for callers that '
92- 'cannot allow-list the header on their parse-server' ,
93- () async {
94- final Map <String , String >? headers = await client.exposedBuildHeaders (
95- ParseNetworkOptions (sendInstallationId: false ),
96- );
72+ test ('attaches X-Parse-Installation-Id by default. Matches iOS '
73+ 'PFURLSessionCommandRunner behaviour — every request carries the '
74+ 'install ID so parse-server can bind created _Session rows to the '
75+ 'right installation and so destroyDuplicatedSessions can clean up '
76+ 'prior sessions on the same install during login' , () async {
77+ final Map <String , String >? headers = await client.exposedBuildHeaders (
78+ null ,
79+ );
80+
81+ expect (headers, isNotNull);
82+ expect (headers! [keyHeaderInstallationId], isNotEmpty);
83+ });
9784
98- expect (
99- headers? [keyHeaderInstallationId],
100- isNull,
101- reason:
102- 'sendInstallationId=false must suppress the header even when '
103- 'an install ID is available' ,
104- );
105- },
106- );
85+ test ('omits X-Parse-Installation-Id when caller passes '
86+ 'sendInstallationId: false. The opt-out is forwarded by methods such '
87+ 'as ParseUser.signUp(doNotSendInstallationID: true) for callers that '
88+ 'cannot allow-list the header on their parse-server' , () async {
89+ final Map <String , String >? headers = await client.exposedBuildHeaders (
90+ ParseNetworkOptions (sendInstallationId: false ),
91+ );
92+
93+ expect (
94+ headers? [keyHeaderInstallationId],
95+ isNull,
96+ reason:
97+ 'sendInstallationId=false must suppress the header even when '
98+ 'an install ID is available' ,
99+ );
100+ });
107101
108102 test (
109103 'preserves a caller-supplied X-Parse-Installation-Id rather than '
@@ -120,20 +114,15 @@ void main() {
120114 },
121115 );
122116
123- test (
124- 'merges caller-supplied headers with the install ID. Custom headers '
125- 'and the auto-attached install ID must coexist — neither side '
126- 'overrides the other' ,
127- () async {
128- final Map <String , String >? headers = await client.exposedBuildHeaders (
129- ParseNetworkOptions (
130- headers: < String , String > {'X-Custom' : 'value' },
131- ),
132- );
117+ test ('merges caller-supplied headers with the install ID. Custom headers '
118+ 'and the auto-attached install ID must coexist — neither side '
119+ 'overrides the other' , () async {
120+ final Map <String , String >? headers = await client.exposedBuildHeaders (
121+ ParseNetworkOptions (headers: < String , String > {'X-Custom' : 'value' }),
122+ );
133123
134- expect (headers! ['X-Custom' ], equals ('value' ));
135- expect (headers[keyHeaderInstallationId], isNotEmpty);
136- },
137- );
124+ expect (headers! ['X-Custom' ], equals ('value' ));
125+ expect (headers[keyHeaderInstallationId], isNotEmpty);
126+ });
138127 });
139128}
0 commit comments