Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -516,26 +516,6 @@ exports[`Results View Should display Base, New and Common graphs with replicates
<td />
<td />
</tr>
<tr
class="test-label-row"
style="margin-top: 2px;"
>
<td>
Distribution
</td>
</tr>
<tr
class="test-row-container"
>
<td>
Estimated Modes
</td>
<td />
<td />
<td>
No modes or data for Base and New, possible oversmoothing, KDE evaluation failed
</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -1061,26 +1041,6 @@ exports[`Results View Should display Base, New and Common graphs with tooltips 1
<td />
<td />
</tr>
<tr
class="test-label-row"
style="margin-top: 2px;"
>
<td>
Distribution
</td>
</tr>
<tr
class="test-row-container"
>
<td>
Estimated Modes
</td>
<td />
<td />
<td>
No modes or data for Base and New, possible oversmoothing, KDE evaluation failed
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
60 changes: 0 additions & 60 deletions src/__tests__/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
truncateHash,
swapArrayElements,
getDocsURL,
getModeInterpretation,
capitalize,
} from '../utils/helpers';
import getTestData from './utils/fixtures';
Expand Down Expand Up @@ -133,65 +132,6 @@ describe('swapArrayElements', () => {
});
});

describe('getModeInterpretation', () => {
const baseMode1 = 1;
const newMode1 = 1;
const baseMode2 = 2;
const newMode2 = 2;
const baseModenull = null;
const newMode0 = 0;
const baseMode0 = 0;
const newModenull = null;

it('should handle same mode count interpretation for base and new', () => {
const expectedStr = getModeInterpretation(baseMode1, newMode1);
expect(expectedStr).toBe('Base and New revisions are unimodal');
const expectedStr2 = getModeInterpretation(baseMode2, newMode2);
expect(expectedStr2).toBe('Base and New revisions are multimodal');
});

it('should handle different mode count interpretation for base and new', () => {
const expectedStr2 = getModeInterpretation(baseMode2, newMode1);
expect(expectedStr2).toBe('Base is multimodal and New is unimodal');
const expectedStr3 = getModeInterpretation(baseMode1, newMode2);
expect(expectedStr3).toBe('Base is unimodal and New is multimodal');
});

it('should get mode interpretation with both baseRev and newRev as null or 0', () => {
const expectedStr4 = getModeInterpretation(baseModenull, newMode0);
expect(expectedStr4).toBe(
'No modes or data for Base and New, possible oversmoothing, KDE evaluation failed',
);
const expectedStr5 = getModeInterpretation(baseModenull, newModenull);
expect(expectedStr5).toBe(
'No modes or data for Base and New, possible oversmoothing, KDE evaluation failed',
);
const expectedStr6 = getModeInterpretation(baseMode0, newMode0);
expect(expectedStr6).toBe(
'No modes or data for Base and New, possible oversmoothing, KDE evaluation failed',
);

const expectedStr7 = getModeInterpretation(baseMode0, newModenull);
expect(expectedStr7).toBe(
'No modes or data for Base and New, possible oversmoothing, KDE evaluation failed',
);
});

it('should get N/A for interpretModeCount one of baseRev or newRev < 1 and not null', () => {
const expectedStr1 = getModeInterpretation(baseMode2, newMode0);
expect(expectedStr1).toBe('Base is multimodal and New is N/A');
const expectedStr2 = getModeInterpretation(baseMode0, newMode2);
expect(expectedStr2).toBe('Base is N/A and New is multimodal');
});

it('should get N/A for interpretModeCount one of baseRev or newRev as null', () => {
const expectedStr0 = getModeInterpretation(baseModenull, newMode1);
expect(expectedStr0).toBe('Base is N/A and New is unimodal');
const expectedStr3 = getModeInterpretation(baseMode1, newModenull);
expect(expectedStr3).toBe('Base is unimodal and New is N/A');
});
});

describe('capitalize', () => {
const string1 = 'i love my dog.';
const string2 = 'monkey';
Expand Down
26 changes: 0 additions & 26 deletions src/__tests__/hooks/useSubtestRegressionCount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ describe('useSubtestRegressionCount', () => {
newParentSignature: '200',
replicates: false,
testVersion: 'mann-whitney-u',
silvermanKDEEnabled: false,
});
});
});
Expand Down Expand Up @@ -245,30 +244,6 @@ describe('useSubtestRegressionCount', () => {
expect(hookResult.current.counts).not.toBeNull();
});

it('passes silvermanKDEEnabled as true when the URL param is present', async () => {
window.history.replaceState(
null,
'',
'/compare-results?baseRev=abc&baseRepo=mozilla-central&framework=1&enable_silverman_kde',
);
mockedFetchCompare.mockResolvedValue([]);

renderHook(() =>
useSubtestRegressionCount({
result: baseResult,
view: compareView,
replicates: false,
testVersion: 'mann-whitney-u',
}),
);

await waitFor(() => {
expect(mockedFetchCompare).toHaveBeenCalledWith(
expect.objectContaining({ silvermanKDEEnabled: true }),
);
});
});

it('calls memoizedFetchSubtestsCompareOverTimeResults with interval from URL for compareOverTimeView', async () => {
window.history.replaceState(
null,
Expand All @@ -290,7 +265,6 @@ describe('useSubtestRegressionCount', () => {
expect(mockedFetchCompareOverTime).toHaveBeenCalledWith(
expect.objectContaining({
interval: 86400,
silvermanKDEEnabled: false,
}),
);
});
Expand Down
Loading