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

stacklok / codegate-ui / 13903674755

17 Mar 2025 03:42PM CUT coverage: 61.874% (-4.6%) from 66.452%
13903674755

Pull #345

github

web-flow
Merge ce2550358 into 5d463ef04
Pull Request #345: feat: react-hook-form field array for provider muxes

443 of 798 branches covered (55.51%)

Branch coverage included in aggregate %.

63 of 93 new or added lines in 21 files covered. (67.74%)

50 existing lines in 4 files now uncovered.

904 of 1379 relevant lines covered (65.55%)

36.88 hits per line

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

0.0
/src/features/workspace/lib/utils.ts
1
import { MuxMatcherType } from '@/api/generated'
2

UNCOV
3
const MUX_MATCHER_TYPE_MAP = {
×
4
  [MuxMatcherType.CHAT_FILENAME]: 'Chat',
5
  [MuxMatcherType.FIM_FILENAME]: 'FIM',
6
  [MuxMatcherType.FILENAME_MATCH]: 'FIM & Chat',
7
  [MuxMatcherType.CATCH_ALL]: 'All types',
8
}
9

10
function getRequestType() {
UNCOV
11
  return Object.values(MuxMatcherType)
×
UNCOV
12
    .filter((item) => item !== MuxMatcherType.CATCH_ALL)
×
UNCOV
13
    .map((textValue) => ({
×
14
      id: textValue,
15
      textValue: MUX_MATCHER_TYPE_MAP[textValue],
16
    }))
17
}
18

19
export function isRequestType(value: unknown): value is MuxMatcherType {
UNCOV
20
  return Object.values(MuxMatcherType).includes(value as MuxMatcherType)
×
21
}
22

UNCOV
23
const DEFAULT_RULE = {
×
24
  placeholder: 'Catch-all',
25
  selectedKey: MuxMatcherType.CATCH_ALL,
26
  items: [
27
    {
28
      id: MuxMatcherType.CATCH_ALL,
29
      textValue: MUX_MATCHER_TYPE_MAP[MuxMatcherType.CATCH_ALL],
30
    },
31
  ],
32
}
33

UNCOV
34
const CUSTOM_RULE = {
×
35
  placeholder: 'e.g. file glob patterns like *.py',
36
  selectedKey: '',
37
  items: getRequestType(),
38
}
39

40
export function getRuleData({
41
  isDefaultRule,
42
  matcher_type,
43
}: {
44
  isDefaultRule: boolean
45
  matcher_type: MuxMatcherType
46
}) {
UNCOV
47
  return isDefaultRule
×
48
    ? DEFAULT_RULE
49
    : {
50
        ...CUSTOM_RULE,
51
        selectedKey: matcher_type,
52
      }
53
}
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

© 2025 Coveralls, Inc