@quenty/saveslot 2.14.3 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +21 -20
- package/src/Server/Binders/HasSaveSlots.Code.spec.lua +101 -116
- package/src/Server/Binders/HasSaveSlots.ExportImport.spec.lua +124 -134
- package/src/Server/Binders/HasSaveSlots.PreSelect.spec.lua +21 -28
- package/src/Server/Binders/HasSaveSlots.SharedStore.spec.lua +70 -92
- package/src/Server/Binders/HasSaveSlots.TransferableEphemeral.spec.lua +166 -179
- package/src/Server/Binders/HasSaveSlots.spec.lua +159 -722
- package/src/Server/Cmdr/SaveSlotCmdrService.spec.lua +3 -2
- package/src/Server/OfflineSaveSlots.spec.lua +9 -23
- package/src/Server/SaveSlotService.LateSettle.spec.lua +3 -5
- package/src/Server/SaveSlotService.LoadFlow.spec.lua +3 -5
- package/src/Server/SaveSlotService.Overflow.spec.lua +3 -5
- package/src/Server/SaveSlotService.Playtime.spec.lua +9 -22
- package/src/Server/SaveSlotService.spec.lua +43 -35
- package/src/Server/SaveSlotSharedDataStoreService.spec.lua +22 -45
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
]]
|
|
9
9
|
local require = require(script.Parent.loader).load(script)
|
|
10
10
|
|
|
11
|
+
local BindToCloseService = require("BindToCloseService")
|
|
11
12
|
local DataStoreMock = require("DataStoreMock")
|
|
12
|
-
local DataStoreTestUtils = require("DataStoreTestUtils")
|
|
13
13
|
local Jest = require("Jest")
|
|
14
14
|
local JestUtils = require("JestUtils")
|
|
15
15
|
local Maid = require("Maid")
|
|
@@ -38,6 +38,7 @@ local function setup()
|
|
|
38
38
|
|
|
39
39
|
local serviceBag = ServiceBag.new()
|
|
40
40
|
local teleportDataService: any = serviceBag:GetService(require("TeleportDataService"))
|
|
41
|
+
local bindToCloseService: BindToCloseService.BindToCloseService = serviceBag:GetService(BindToCloseService) :: any
|
|
41
42
|
local playerDataStoreService: PlayerDataStoreService.PlayerDataStoreService =
|
|
42
43
|
serviceBag:GetService(PlayerDataStoreService) :: any
|
|
43
44
|
local sharedService: SaveSlotSharedDataStoreService.SaveSlotSharedDataStoreService =
|
|
@@ -54,10 +55,8 @@ local function setup()
|
|
|
54
55
|
local hasSaveSlots = assert(binder:Bind(fakePlayer), "Failed to bind HasSaveSlots")
|
|
55
56
|
hasSaveSlots.MaxSlotCount.Value = 5
|
|
56
57
|
|
|
57
|
-
-- A PlayerMock never fires the real Players.PlayerRemoving, and the store the spec loaded is only
|
|
58
|
-
-- destroyed by a removal, so shut it down the way Roblox does or its auto-save loop outlives this spec.
|
|
59
58
|
maid:GiveTask(function()
|
|
60
|
-
|
|
59
|
+
PromiseTestUtils.awaitFulfilled(bindToCloseService:PromiseClose())
|
|
61
60
|
fakePlayer:Destroy()
|
|
62
61
|
serviceBag:Destroy()
|
|
63
62
|
end)
|
|
@@ -80,263 +79,251 @@ local function setup()
|
|
|
80
79
|
return controller
|
|
81
80
|
end
|
|
82
81
|
|
|
83
|
-
local function runWithContext(body)
|
|
84
|
-
local context = setup()
|
|
85
|
-
local ok, err = pcall(body, context)
|
|
86
|
-
context:Destroy()
|
|
87
|
-
if not ok then
|
|
88
|
-
error(err, 0)
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
local function awaitValueOf(promise)
|
|
93
|
-
if not PromiseTestUtils.awaitSettled(promise, 10) then
|
|
94
|
-
error("promise hung", 0)
|
|
95
|
-
end
|
|
96
|
-
local ok, value = promise:Yield()
|
|
97
|
-
if not ok then
|
|
98
|
-
error(`promise rejected: {tostring(value)}`, 0)
|
|
99
|
-
end
|
|
100
|
-
return value
|
|
101
|
-
end
|
|
102
|
-
|
|
103
82
|
-- What a teleport re-save leaves behind, and the only thing the arrival path will load.
|
|
104
83
|
local function writeTransfer(context: any, key: string, export)
|
|
105
|
-
return
|
|
84
|
+
return PromiseTestUtils.awaitFulfilled(
|
|
106
85
|
context.sharedService:PromiseWrite(key, SaveSlotExportUtils.withKind(export, SaveSlotExportUtils.Kind.TRANSFER))
|
|
107
86
|
)
|
|
108
87
|
end
|
|
109
88
|
|
|
110
|
-
local function awaitResolved(promise): boolean
|
|
111
|
-
if not PromiseTestUtils.awaitSettled(promise, 10) then
|
|
112
|
-
error("promise hung", 0)
|
|
113
|
-
end
|
|
114
|
-
return (promise:Yield())
|
|
115
|
-
end
|
|
116
|
-
|
|
117
89
|
local function activeSlotData(hasSaveSlots)
|
|
118
|
-
local store =
|
|
119
|
-
return
|
|
90
|
+
local store = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseActiveSlotStore())
|
|
91
|
+
return PromiseTestUtils.awaitFulfilled(store:LoadAll({}))
|
|
120
92
|
end
|
|
121
93
|
|
|
122
94
|
describe("HasSaveSlots.PromiseSelectTransferableEphemeralSlot", function()
|
|
123
95
|
it("loads a transferable ephemeral slot from a shared-store key", function()
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
96
|
+
local context = setup()
|
|
97
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
98
|
+
writeTransfer(context, "code-1", { data = { Coins = 5, World_2 = { Eggs = 1 } }, slotName = "Snap" })
|
|
99
|
+
|
|
100
|
+
local slotId = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseSelectTransferableEphemeralSlot("code-1"))
|
|
101
|
+
expect(hasSaveSlots.ActiveSlotId.Value).toEqual(slotId)
|
|
127
102
|
|
|
128
|
-
|
|
129
|
-
|
|
103
|
+
local data = activeSlotData(hasSaveSlots)
|
|
104
|
+
expect(data.Coins).toEqual(5)
|
|
105
|
+
expect(data.World_2.Eggs).toEqual(1)
|
|
130
106
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
expect(data.World_2.Eggs).toEqual(1)
|
|
107
|
+
local metadata = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseGetSlotMetadata(slotId))
|
|
108
|
+
expect(metadata.IsEphemeral).toEqual(true)
|
|
134
109
|
|
|
135
|
-
|
|
136
|
-
expect(metadata.IsEphemeral).toEqual(true)
|
|
137
|
-
end)
|
|
110
|
+
context:Destroy()
|
|
138
111
|
end)
|
|
139
112
|
|
|
140
113
|
it("rejects when the key holds no export", function()
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
114
|
+
local context = setup()
|
|
115
|
+
PromiseTestUtils.awaitRejected(context.hasSaveSlots:PromiseSelectTransferableEphemeralSlot("missing"))
|
|
116
|
+
|
|
117
|
+
context:Destroy()
|
|
144
118
|
end)
|
|
145
119
|
|
|
146
120
|
it("rejects when the shared store holds a value that is not a valid export", function()
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
121
|
+
local context = setup()
|
|
122
|
+
PromiseTestUtils.awaitFulfilled(context.sharedService:PromiseWrite("corrupt", { notAnExport = true }))
|
|
123
|
+
PromiseTestUtils.awaitRejected(context.hasSaveSlots:PromiseSelectTransferableEphemeralSlot("corrupt"))
|
|
124
|
+
|
|
125
|
+
context:Destroy()
|
|
151
126
|
end)
|
|
152
127
|
|
|
153
128
|
it("rejects when the shared store read fails", function()
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
129
|
+
local context = setup()
|
|
130
|
+
writeTransfer(context, "code-x", { data = { Coins = 1 } })
|
|
131
|
+
context.sharedMock:FailNextRequests(1)
|
|
132
|
+
PromiseTestUtils.awaitRejected(context.hasSaveSlots:PromiseSelectTransferableEphemeralSlot("code-x"))
|
|
133
|
+
|
|
134
|
+
context:Destroy()
|
|
159
135
|
end)
|
|
160
136
|
|
|
161
137
|
it("refuses a share code, which is what keeps a leaked one from being played", function()
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
)
|
|
138
|
+
local context = setup()
|
|
139
|
+
-- The key reaching this path comes from the arriving client, so a code a player was handed
|
|
140
|
+
-- must not load here. It is redeemed through PromiseImportEphemeralSaveSlotFromCode instead.
|
|
141
|
+
PromiseTestUtils.awaitFulfilled(
|
|
142
|
+
context.sharedService:PromiseWrite(
|
|
143
|
+
"shared-code",
|
|
144
|
+
SaveSlotExportUtils.withKind({ data = { Coins = 5 } }, SaveSlotExportUtils.Kind.CODE)
|
|
170
145
|
)
|
|
146
|
+
)
|
|
171
147
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
end)
|
|
148
|
+
PromiseTestUtils.awaitRejected(context.hasSaveSlots:PromiseSelectTransferableEphemeralSlot("shared-code"))
|
|
149
|
+
|
|
150
|
+
context:Destroy()
|
|
176
151
|
end)
|
|
177
152
|
|
|
178
153
|
it("refuses an entry written before kinds existed, which may be a code", function()
|
|
179
|
-
|
|
180
|
-
|
|
154
|
+
local context = setup()
|
|
155
|
+
PromiseTestUtils.awaitFulfilled(context.sharedService:PromiseWrite("legacy", { data = { Coins = 5 } }))
|
|
156
|
+
|
|
157
|
+
PromiseTestUtils.awaitRejected(context.hasSaveSlots:PromiseSelectTransferableEphemeralSlot("legacy"))
|
|
181
158
|
|
|
182
|
-
|
|
183
|
-
end)
|
|
159
|
+
context:Destroy()
|
|
184
160
|
end)
|
|
185
161
|
end)
|
|
186
162
|
|
|
187
163
|
describe("HasSaveSlots.PromiseImportEphemeralSaveSlotFromCode", function()
|
|
188
164
|
local function writeCode(context: any, key: string, export)
|
|
189
|
-
return
|
|
165
|
+
return PromiseTestUtils.awaitFulfilled(
|
|
190
166
|
context.sharedService:PromiseWrite(key, SaveSlotExportUtils.withKind(export, SaveSlotExportUtils.Kind.CODE))
|
|
191
167
|
)
|
|
192
168
|
end
|
|
193
169
|
|
|
194
170
|
it("redeems a share code into a transferable ephemeral slot", function()
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
171
|
+
local context = setup()
|
|
172
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
173
|
+
writeCode(context, "code-redeem", { data = { Coins = 5 } })
|
|
174
|
+
|
|
175
|
+
local slotId =
|
|
176
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseImportEphemeralSaveSlotFromCode("code-redeem"))
|
|
177
|
+
expect(hasSaveSlots.ActiveSlotId.Value).toEqual(slotId)
|
|
178
|
+
expect(activeSlotData(hasSaveSlots).Coins).toEqual(5)
|
|
179
|
+
|
|
180
|
+
context:Destroy()
|
|
203
181
|
end)
|
|
204
182
|
|
|
205
183
|
it("still redeems a code written before kinds existed", function()
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
184
|
+
local context = setup()
|
|
185
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
186
|
+
PromiseTestUtils.awaitFulfilled(context.sharedService:PromiseWrite("legacy-code", { data = { Coins = 9 } }))
|
|
187
|
+
|
|
188
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseImportEphemeralSaveSlotFromCode("legacy-code"))
|
|
189
|
+
expect(activeSlotData(hasSaveSlots).Coins).toEqual(9)
|
|
209
190
|
|
|
210
|
-
|
|
211
|
-
expect(activeSlotData(hasSaveSlots).Coins).toEqual(9)
|
|
212
|
-
end)
|
|
191
|
+
context:Destroy()
|
|
213
192
|
end)
|
|
214
193
|
|
|
215
194
|
it("transfers onward under a fresh key, so the code itself is never published", function()
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
195
|
+
local context = setup()
|
|
196
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
197
|
+
writeCode(context, "code-onward", { data = { Coins = 5 } })
|
|
198
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseImportEphemeralSaveSlotFromCode("code-onward"))
|
|
199
|
+
|
|
200
|
+
-- The client carries this key across a teleport and every client can read it, so it must not
|
|
201
|
+
-- be the code -- and the slice must not write a transfer over the code's entry.
|
|
202
|
+
local transferKey = assert(hasSaveSlots.ActiveTransferableEphemeralKey.Value, "No transfer key")
|
|
203
|
+
expect(transferKey).never.toEqual("code-onward")
|
|
204
|
+
|
|
205
|
+
local slice = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseBuildEphemeralTransferSlice())
|
|
206
|
+
expect(slice[EPHEMERAL_KEY]).toEqual(transferKey)
|
|
207
|
+
|
|
208
|
+
local code = PromiseTestUtils.awaitFulfilled(context.sharedService:PromiseRead("code-onward"))
|
|
209
|
+
expect(code.kind).toEqual(SaveSlotExportUtils.Kind.CODE)
|
|
210
|
+
|
|
211
|
+
-- And the fresh key holds a transfer, which is what the arrival path will accept.
|
|
212
|
+
local transfer = PromiseTestUtils.awaitFulfilled(context.sharedService:PromiseRead(transferKey))
|
|
213
|
+
expect(transfer.kind).toEqual(SaveSlotExportUtils.Kind.TRANSFER)
|
|
214
|
+
|
|
215
|
+
context:Destroy()
|
|
236
216
|
end)
|
|
237
217
|
end)
|
|
238
218
|
|
|
239
219
|
describe("HasSaveSlots.PromiseBuildEphemeralTransferSlice", function()
|
|
240
220
|
it("re-saves the live state and carries the key", function()
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
221
|
+
local context = setup()
|
|
222
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
223
|
+
writeTransfer(context, "code-2", { data = { Coins = 5 } })
|
|
224
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseSelectTransferableEphemeralSlot("code-2"))
|
|
225
|
+
|
|
226
|
+
-- Mutate live state after loading.
|
|
227
|
+
local store = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseActiveSlotStore())
|
|
228
|
+
store:Store("Coins", 99)
|
|
229
|
+
|
|
230
|
+
local slice = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseBuildEphemeralTransferSlice())
|
|
231
|
+
expect(slice[EPHEMERAL_KEY]).toEqual("code-2")
|
|
232
|
+
|
|
233
|
+
-- The shared store now holds the mutated live state, not the state we loaded.
|
|
234
|
+
local saved = PromiseTestUtils.awaitFulfilled(context.sharedService:PromiseRead("code-2"))
|
|
235
|
+
expect(saved.data.Coins).toEqual(99)
|
|
236
|
+
|
|
237
|
+
context:Destroy()
|
|
257
238
|
end)
|
|
258
239
|
|
|
259
240
|
it("resolves nil when the active slot is not a transferable ephemeral slot", function()
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
241
|
+
local context = setup()
|
|
242
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
243
|
+
local slotId = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseCreateSlot(2))
|
|
244
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseSelectSlot(slotId))
|
|
245
|
+
|
|
246
|
+
expect(PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseBuildEphemeralTransferSlice())).toBeNil()
|
|
264
247
|
|
|
265
|
-
|
|
266
|
-
end)
|
|
248
|
+
context:Destroy()
|
|
267
249
|
end)
|
|
268
250
|
|
|
269
251
|
it("degrades to nil (does not block the teleport) when the re-save fails", function()
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
252
|
+
local context = setup()
|
|
253
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
254
|
+
writeTransfer(context, "code-5", { data = { Coins = 5 } })
|
|
255
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseSelectTransferableEphemeralSlot("code-5"))
|
|
256
|
+
|
|
257
|
+
-- The re-save write fails; the slice must resolve nil rather than reject.
|
|
258
|
+
context.sharedMock:FailNextRequests(1)
|
|
259
|
+
expect(PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseBuildEphemeralTransferSlice())).toBeNil()
|
|
260
|
+
|
|
261
|
+
context:Destroy()
|
|
279
262
|
end)
|
|
280
263
|
end)
|
|
281
264
|
|
|
282
265
|
describe("HasSaveSlots.PromiseLoadTransferableEphemeralSlotFromTeleport", function()
|
|
283
266
|
it("re-selects the slot from a key in the trusted band", function()
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
267
|
+
local context = setup()
|
|
268
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
269
|
+
writeTransfer(context, "code-3", { data = { Coins = 7 } })
|
|
287
270
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
271
|
+
context.teleportDataService:SetTrustedArrivedTeleportDataForTesting(
|
|
272
|
+
context.fakePlayer,
|
|
273
|
+
{ [EPHEMERAL_KEY] = "code-3" }
|
|
274
|
+
)
|
|
275
|
+
context.teleportDataService:SetNonTrustedArrivedTeleportDataForTesting(context.fakePlayer, nil) -- seal
|
|
276
|
+
|
|
277
|
+
local slotId = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseLoadTransferableEphemeralSlotFromTeleport())
|
|
278
|
+
expect(type(slotId)).toEqual("string")
|
|
279
|
+
expect(activeSlotData(hasSaveSlots).Coins).toEqual(7)
|
|
293
280
|
|
|
294
|
-
|
|
295
|
-
expect(type(slotId)).toEqual("string")
|
|
296
|
-
expect(activeSlotData(hasSaveSlots).Coins).toEqual(7)
|
|
297
|
-
end)
|
|
281
|
+
context:Destroy()
|
|
298
282
|
end)
|
|
299
283
|
|
|
300
284
|
it("re-selects the slot from a key in the client band (client-initiated teleport)", function()
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
285
|
+
local context = setup()
|
|
286
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
287
|
+
writeTransfer(context, "code-4", { data = { Coins = 7 } })
|
|
288
|
+
|
|
289
|
+
-- Egg-hunt's menu resume is a client-initiated teleport, so the key rides the client band; the
|
|
290
|
+
-- unified arrival read honors it (see PromiseLoadTransferableEphemeralSlotFromTeleport).
|
|
291
|
+
context.teleportDataService:SetNonTrustedArrivedTeleportDataForTesting(
|
|
292
|
+
context.fakePlayer,
|
|
293
|
+
{ [EPHEMERAL_KEY] = "code-4" }
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
local slotId = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseLoadTransferableEphemeralSlotFromTeleport())
|
|
297
|
+
expect(type(slotId)).toEqual("string")
|
|
298
|
+
expect(activeSlotData(hasSaveSlots).Coins).toEqual(7)
|
|
311
299
|
|
|
312
|
-
|
|
313
|
-
expect(type(slotId)).toEqual("string")
|
|
314
|
-
expect(activeSlotData(hasSaveSlots).Coins).toEqual(7)
|
|
315
|
-
end)
|
|
300
|
+
context:Destroy()
|
|
316
301
|
end)
|
|
317
302
|
end)
|
|
318
303
|
|
|
319
304
|
describe("HasSaveSlots.ActiveTransferableEphemeralKey (replicated for the client teleport provider)", function()
|
|
320
305
|
it("reflects the active transferable-ephemeral key and clears it on deselect", function()
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
306
|
+
local context = setup()
|
|
307
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
308
|
+
writeTransfer(context, "code-6", { data = { Coins = 1 } })
|
|
324
309
|
|
|
325
|
-
|
|
326
|
-
|
|
310
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseSelectTransferableEphemeralSlot("code-6"))
|
|
311
|
+
expect(hasSaveSlots.ActiveTransferableEphemeralKey.Value).toEqual("code-6")
|
|
327
312
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
313
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseDeselectSlot())
|
|
314
|
+
expect(hasSaveSlots.ActiveTransferableEphemeralKey.Value).toBeNil()
|
|
315
|
+
|
|
316
|
+
context:Destroy()
|
|
331
317
|
end)
|
|
332
318
|
|
|
333
319
|
it("is nil while a normal (non-transferable) slot is active", function()
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
320
|
+
local context = setup()
|
|
321
|
+
local hasSaveSlots = context.hasSaveSlots
|
|
322
|
+
local slotId = PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseCreateSlot(2))
|
|
323
|
+
PromiseTestUtils.awaitFulfilled(hasSaveSlots:PromiseSelectSlot(slotId))
|
|
324
|
+
|
|
325
|
+
expect(hasSaveSlots.ActiveTransferableEphemeralKey.Value).toBeNil()
|
|
338
326
|
|
|
339
|
-
|
|
340
|
-
end)
|
|
327
|
+
context:Destroy()
|
|
341
328
|
end)
|
|
342
329
|
end)
|