mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Update migration to clear all old non-account data
This is necessary to support the new internal format
This commit is contained in:
@@ -40,8 +40,8 @@ describe('A SingleContainerJsonStorage', (): void => {
|
||||
entries.push(entry);
|
||||
}
|
||||
expect(entries).toEqual([
|
||||
[ '/foo', { id: 'http://example.com/.internal/accounts/foo' }],
|
||||
[ '/baz', { id: 'http://example.com/.internal/accounts/baz' }],
|
||||
[ 'foo', { id: 'http://example.com/.internal/accounts/foo' }],
|
||||
[ 'baz', { id: 'http://example.com/.internal/accounts/baz' }],
|
||||
]);
|
||||
expect(store.getRepresentation).toHaveBeenCalledTimes(4);
|
||||
expect(store.getRepresentation).toHaveBeenNthCalledWith(1,
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('A V6MigrationInitializer', (): void => {
|
||||
versionStorage,
|
||||
accountStorage,
|
||||
clientCredentialsStorage,
|
||||
forgotPasswordStorage,
|
||||
cleanupStorages: [ accountStorage, clientCredentialsStorage, forgotPasswordStorage ],
|
||||
newStorage,
|
||||
skipConfirmation: true,
|
||||
});
|
||||
@@ -190,7 +190,7 @@ describe('A V6MigrationInitializer', (): void => {
|
||||
versionStorage,
|
||||
accountStorage,
|
||||
clientCredentialsStorage,
|
||||
forgotPasswordStorage,
|
||||
cleanupStorages: [ accountStorage, clientCredentialsStorage, forgotPasswordStorage ],
|
||||
newStorage,
|
||||
skipConfirmation: false,
|
||||
});
|
||||
@@ -210,14 +210,5 @@ describe('A V6MigrationInitializer', (): void => {
|
||||
await expect(initializer.handle()).rejects.toThrow('Stopping server as migration was cancelled.');
|
||||
expect(newStorage.create).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it('does not show the prompt if there are no accounts.', async(): Promise<void> => {
|
||||
settings = {};
|
||||
accounts = {};
|
||||
await expect(initializer.handle()).resolves.toBeUndefined();
|
||||
expect(questionMock).toHaveBeenCalledTimes(0);
|
||||
expect(accountStorage.get).toHaveBeenCalledTimes(0);
|
||||
expect(newStorage.create).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user