
I've updated to appwrite 1.5 and and node-appwrite 12.0.1. Whenever I try to run a test which fakes the system time my request to create a new document keeps processing and does not complete at all. This is the code:
it('Should return work when an active work period is active', async () => {
// Arrange
const startDate = new Date(2024, 2, 2, 12).toISOString();
jest.useFakeTimers().setSystemTime(new Date(2024, 2, 2, 13));
await presencePeriodRepo.createDocument({
userId: testUserId,
startDate,
type: PresencePeriodType.Work,
expectedEndDate: new Date(2024, 2, 2, 17).toISOString(),
});
// Act
const result = await controller.getPresenceStatus(client);
// Assert
expect(result.status).toBe(PresenceStatus.Work);
})
Whenever I remove the usefakeTimers line the createDocument call completes just fine. This is the implementation of the createDocument function:
public async createDocument(data: Schema, permissions?: string[]): Promise<Schema & Models.Document> {
return this.databases.createDocument(this.databaseId, this.collectionId, ID.unique(), data, permissions);
}
Note this code was working fine in Appwrite 1.4.
Recommended threads
- Is there is a way to integrate Onyx.ai s...
my webapp will have lots of queries that will will text based searches like users, , posts and comments. I wanted to use Elasticsearch first but was recommended...
- Issue with create collection button.
i can't find the create collection button. instead of that create tables is appearing.
- Queries Length Error.
Hi All, I am having a issues across my app with how i am getting data, and just wanted to check if this was an issues with the new changes on appwrite over the...
