patchwise-agent-studio / web /src /domain /glossary.test.ts
EnergyVenom's picture
Astra: PO/GL actions, usage coverage, assisted sign-in, self-healing, recorder, new top navigation and theme (172a4e22a2bf)
fb62a97 verified
Raw History Blame Contribute Delete
856 Bytes
import { describe, expect, it } from 'vitest';
import { failureCause } from './glossary';
describe('failure causes', () => {
it('keeps the pod or network apart from a slow page, and neither is a product defect', () => {
expect(failureCause('environment')).toEqual({ words: 'Environment problem (pod or network)', tone: 'mint', side: 'testing' });
expect(failureCause('timing').words).toMatch(/^Timing/);
expect(failureCause('timing').words).not.toMatch(/environment/i);
expect(failureCause('timing').tone).not.toBe(failureCause('environment').tone);
expect(failureCause('real_defect').side).toBe('product');
});
it('says the cause is not clear for a missing or unknown category', () => {
expect(failureCause(null).words).toBe('Cause not clear yet');
expect(failureCause('something_new').side).toBe('unknown');
});
});