@@ -163,12 +163,15 @@ describe("jwe", function() {
163
163
. then ( function ( result ) {
164
164
// result.plaintext is a buffer, assert.equal will invoke its
165
165
// toString() method implicitly
166
- assert . equal ( result . plaintext , input . plaintext ) ;
166
+ assert . equal ( result . payload , input . plaintext ) ;
167
167
168
168
// But let's make it clear that result.plaintext needs to be
169
169
// converted before actually being a string.
170
- var plaintext = result . plaintext . toString ( ) ;
170
+ var plaintext = result . payload . toString ( ) ;
171
171
assert . deepEqual ( plaintext , input . plaintext ) ;
172
+
173
+ // Verify that plaintext and payload are the same thing
174
+ assert . equal ( result . plaintext , result . payload ) ;
172
175
} ) ;
173
176
} ) ;
174
177
}
@@ -185,6 +188,9 @@ describe("jwe", function() {
185
188
// converted before actually being a string.
186
189
var plaintext = result . plaintext . toString ( ) ;
187
190
assert . deepEqual ( plaintext , input . plaintext ) ;
191
+
192
+ // Verify that plaintext and payload are the same thing
193
+ assert . equal ( result . plaintext , result . payload ) ;
188
194
} ) ;
189
195
} ) ;
190
196
}
@@ -201,6 +207,9 @@ describe("jwe", function() {
201
207
// converted before actually being a string.
202
208
var plaintext = result . plaintext . toString ( ) ;
203
209
assert . deepEqual ( plaintext , input . plaintext ) ;
210
+
211
+ // Verify that plaintext and payload are the same thing
212
+ assert . equal ( result . plaintext , result . payload ) ;
204
213
} ) ;
205
214
} ) ;
206
215
}
0 commit comments