Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Sep 1, 2023
1 parent 3f45776 commit dcb982e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</ul>
<sensitivity-param-values v-if="settings.variationType !== 'Custom'"
:batch-pars="allBatchPars[idx]"
:param-name="settings.parameterToVary!">
:param-name="settings.parameterToVary">
</sensitivity-param-values>
<hr v-if="idx < allSettings.length-1" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,25 @@ const mockTooltipDirective = jest.fn();
describe("SensitivityOptions", () => {
const mockBatchPars = {
varying: [{
name: "B",
name: "A",
values: [1, 2, 3]
}]
} as any;

const mockMultiBatchPars = [
mockBatchPars,
{ name: "B", values: [4, 5] },
{ name: "C", values: [6, 7, 8] }
{
varying: [{
name: "B",
values: [4, 5]
}]
},
{
varying: [{
name: "C",
values: [6, 7, 8]
}]
}
] as any;

const mockSensitivitySetParamSettings = jest.fn();
Expand Down
14 changes: 12 additions & 2 deletions app/static/tests/unit/store/multiSensitivity/getters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,18 @@ describe("MultiSensitivity getters", () => {

const result = getters[MultiSensitivityGetter.multiBatchPars](state, getters, rootState, {} as any);
expect(result).toStrictEqual([
{ name: "A", values: [1, 2, 3], base: parameterValues },
{ name: "B", values: [1, 2, 3, 4, 5], base: parameterValues }
{
varying: [
{ name: "A", values: [1, 2, 3] }
],
base: parameterValues
},
{
varying: [
{ name: "B", values: [1, 2, 3, 4, 5] }
],
base: parameterValues
}
]);
expect(mockSpyDisplace).toHaveBeenCalledTimes(1);
expect(mockSpyRange).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit dcb982e

Please sign in to comment.