(key, testState)
| 1920 | }; |
| 1921 | |
| 1922 | const getCapabilityState = (key, testState) => { |
| 1923 | const checks = Array.isArray(testState?.checks) ? testState.checks : []; |
| 1924 | const found = checks.find((check) => check.key === key); |
| 1925 | if (found) return normalizeCheckState(found.state); |
| 1926 | |
| 1927 | const caps = testState && typeof testState.capabilities === 'object' |
| 1928 | ? testState.capabilities |
| 1929 | : {}; |
| 1930 | if (!Object.prototype.hasOwnProperty.call(caps, key)) return 'unknown'; |
| 1931 | if (caps[key] === true) return 'ok'; |
| 1932 | if (caps[key] === false) return 'fail'; |
| 1933 | return 'skipped'; |
| 1934 | }; |
| 1935 | |
| 1936 | const getCapabilityTitle = (key, testState, state) => { |
| 1937 | const label = capabilityLabelMap[key] || key; |
no test coverage detected