• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kiva / ui / 15857960360

24 Jun 2025 05:59PM UTC coverage: 52.572% (+4.7%) from 47.876%
15857960360

push

github

emuvente
fix: add alt text for user avatar

1787 of 3592 branches covered (49.75%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

289 existing lines in 18 files now uncovered.

2628 of 4806 relevant lines covered (54.68%)

281.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/api/ExperimentIdLink.js
1
import { setContext } from '@apollo/client/link/context/index';
2
import experimentVersionFragment from '#src/graphql/fragments/experimentVersion.graphql';
3
// import { UIAB_COOKIE_NAME } from '#src/util/experiment/experimentUtils';
4

5
// Experiment assignments that will be passed in the X-Experiment Header
6
const targetIds = [
×
7
        'EXP-ML-Service-Bandit-LendByCategory',
8
        'EXP-FLSS-Ongoing-Sitewide-3'
9
];
10

11
function buildExpHeaders(cache) {
12
        const experimentAssignments = [];
×
13

14
        targetIds.forEach(id => {
×
15
                const exp = cache?.readFragment({
×
16
                        id: `Experiment:${id}`,
17
                        fragment: experimentVersionFragment,
18
                }) ?? {};
19

20
                if (exp.version) {
×
21
                        experimentAssignments.push(`${id};${exp.version}`);
×
22
                }
23
        });
24

25
        return experimentAssignments.join();
×
26
}
27

28
export default ({ cookieStore }) => {
29
        return setContext((operation, previousContext) => {
×
UNCOV
30
                if (!cookieStore) return previousContext;
×
31

32
                // Initialize new context
UNCOV
33
                const newContext = { ...previousContext };
×
UNCOV
34
                newContext.headers = newContext.headers ?? {};
×
35

36
                // Fetch experiment header values
UNCOV
37
                const experimentHeader = buildExpHeaders(previousContext?.cache);
×
38
                // TODO: Uncomment once X-UIAB header is allowed by the API
39
                // const uiabValue = cookieStore.get(UIAB_COOKIE_NAME) ?? '';
40

41
                // Add headers to context and pass along
UNCOV
42
                if (experimentHeader) {
×
UNCOV
43
                        newContext.headers['X-Experiments'] = experimentHeader;
×
44
                }
45
                // if (uiabValue) {
46
                //         newContext.headers['X-UIAB'] = uiabValue;
47
                // }
48

UNCOV
49
                return newContext;
×
50
        });
51
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc