Skip to content

Commit d8c640d

Browse files
committed
add stubs and correct unit test
1 parent ad46353 commit d8c640d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/unit/delete-account-confirm-request-test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ describe('DeleteAccountConfirmRequest', () => {
189189
const webId = 'https://alice.example.com/#me'
190190
const user = { webId, id: webId }
191191
const accountManager = {
192-
userAccountFrom: sinon.stub().returns(user)
192+
userAccountFrom: sinon.stub().returns(user),
193+
accountDirFor: sinon.stub().returns('/some/path/to/data/for/alice.example.com/')
193194
}
194195
const userStore = {
195196
deleteUser: sinon.stub().resolves()
@@ -204,8 +205,8 @@ describe('DeleteAccountConfirmRequest', () => {
204205
return request.deleteAccount(tokenContents)
205206
.then(() => {
206207
expect(accountManager.userAccountFrom).to.have.been.calledWith(tokenContents)
207-
expect(userStore.deleteUser).to.have.been.calledWith(user.id)
208-
// TODO: @kjetilk Include the last method for deleting from fs
208+
expect(accountManager.accountDirFor).to.have.been.calledWith(user.username)
209+
expect(userStore.deleteUser).to.have.been.calledWith(user)
209210
})
210211
})
211212
})

0 commit comments

Comments
 (0)