Skip to main content

Update tests

To update your tests for FT4 authentication, it is essential to understand how the authentication process works with FT4. For any operation that requires authentication, you must call ft_auth_operation_for within the same transaction, directly before the operation being tested.

Begin by importing ft_auth_operation_for from the FT4 test utilities:

import lib.ft4.test.utils.{ ft_auth_operation_for };

In each test, use ft_auth_operation_for to simulate the necessary authentication for the operation. This function helps set up the required authentication state so your operations can execute as expected.

For instance, to test an operation that requires FT4 authentication, you would call ft_auth_operation_for immediately before the operation within the transaction block.

In the next lesson, we’ll break down the app into multiple modules to improve its structure.