2023-09-20 00:59:08 +03:00
|
|
|
const globalCoverage = {
|
2024-01-13 14:35:30 +03:00
|
|
|
statements: 60,
|
|
|
|
lines: 60,
|
|
|
|
functions: 60,
|
|
|
|
exclude: ['src/generated/**/*'],
|
2023-09-20 00:59:08 +03:00
|
|
|
};
|
|
|
|
|
2023-09-19 05:07:38 +03:00
|
|
|
const modulesCoverage = {
|
2024-04-02 13:07:12 +03:00
|
|
|
statements: 70,
|
|
|
|
lines: 70,
|
|
|
|
functions: 65,
|
2024-01-13 14:35:30 +03:00
|
|
|
include: ['src/modules/**/*'],
|
2024-02-24 21:12:21 +03:00
|
|
|
exclude: ['src/**/*.ts'],
|
2023-09-19 05:07:38 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
const pagesCoverage = {
|
Feat/put target object identifier on use activities (#4682)
When writing to the normalized cache (record), it's crucial to use _refs
for relationships to avoid many problems. Essentially, we only deal with
level 0 and generate all fields to be comfortable with their defaults.
When writing in queries (which should be very rare, the only cases are
prefetch and the case of activities due to the nested query; I've
reduced this to a single file for activities
usePrepareFindManyActivitiesQuery 🙂), it's important to use queryFields
to avoid bugs. I've implemented them on the side of query generation and
record generation.
When doing an updateOne / createOne, etc., it's necessary to distinguish
between optimistic writing (which we actually want to do with _refs) and
the server response without refs. This allows for a clean write in the
optimistic cache without worrying about nesting (as the first point).
To simplify the whole activities part, write to the normalized cache
first. Then, base queries on it in an idempotent manner. This way,
there's no need to worry about the current page or action. The
normalized cache is up-to-date, so I update the queries. Same idea as
for optimisticEffects, actually.
Finally, I've triggered optimisticEffects rather than the manual update
of many queries.
---------
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-04-01 14:12:37 +03:00
|
|
|
statements: 55,
|
|
|
|
lines: 55,
|
2024-01-13 14:35:30 +03:00
|
|
|
functions: 45,
|
2024-02-24 21:12:21 +03:00
|
|
|
exclude: ['src/generated/**/*', 'src/modules/**/*', 'src/**/*.ts'],
|
2023-09-19 05:07:38 +03:00
|
|
|
};
|
|
|
|
|
2023-10-16 23:06:07 +03:00
|
|
|
const storybookStoriesFolders = process.env.STORYBOOK_SCOPE;
|
2023-09-20 00:59:08 +03:00
|
|
|
|
2024-01-13 14:35:30 +03:00
|
|
|
module.exports =
|
|
|
|
storybookStoriesFolders === 'pages'
|
|
|
|
? pagesCoverage
|
|
|
|
: storybookStoriesFolders === 'modules'
|
|
|
|
? modulesCoverage
|
|
|
|
: globalCoverage;
|