Add moar tests

Co-authored-by: Fredrik Adelöw <freben@users.noreply.github.com>
Co-authored-by: Ben Lambert <ben@blam.sh>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2021-04-26 14:12:57 +02:00
committed by blam
parent 19b07a6f67
commit e0c39cd7e3
@@ -359,16 +359,26 @@ describe('Default Processing Database', () => {
});
});
const currentRefreshState = await db<DbRefreshStateRow>(
'refresh_state',
).select();
const currentRefRowState = await db<DbRefreshStateReferencesRow>(
'refresh_state_references',
).select();
expect(currentRefRowState).toEqual({
source_key: 'config-2',
target_entity_ref: 'location:default/root',
});
expect(currentRefRowState).toEqual([
expect.objectContaining({
source_key: 'config-2',
target_entity_ref: 'location:default/root',
}),
]);
// TODO: assert that root wasn't removed
expect(currentRefreshState).toEqual([
expect.objectContaining({
entity_ref: 'location:default/root',
}),
]);
});
it('should remove old locations using the delta options', async () => {