Skip to content

Commit

Permalink
fix(api): bad group matching when raid labels have different endings
Browse files Browse the repository at this point in the history
for #295
  • Loading branch information
MauriceNino committed Sep 16, 2022
1 parent 273f911 commit db8d49f
Show file tree
Hide file tree
Showing 4 changed files with 445 additions and 15 deletions.
8 changes: 7 additions & 1 deletion apps/api/__TESTS__/dynamic-info.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { expect } from 'chai';
import { mapToStorageOutput } from '../src/dynamic-info';
import {
TestCase,
TEST_CASE_1,
TEST_CASE_10,
TEST_CASE_11,
TEST_CASE_2,
TEST_CASE_3,
TEST_CASE_4,
Expand All @@ -13,7 +15,7 @@ import {
TEST_CASE_9,
} from './test-cases';

const toStorageInp = (inp: { layout: any; blocks: any; sizes: any }) =>
const toStorageInp = (inp: TestCase) =>
[inp.layout, inp.blocks, inp.sizes] as const;

describe('Dynamic Info', () => {
Expand Down Expand Up @@ -58,5 +60,9 @@ describe('Dynamic Info', () => {
const output = mapToStorageOutput(...toStorageInp(TEST_CASE_10));
expect(output).to.deep.equal(TEST_CASE_10.output);
});
it('Test Case 11', () => {
const output = mapToStorageOutput(...toStorageInp(TEST_CASE_11));
expect(output).to.deep.equal(TEST_CASE_11.output);
});
});
});
8 changes: 7 additions & 1 deletion apps/api/__TESTS__/static-info.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { expect } from 'chai';
import { mapToStorageLayout } from '../src/static-info';
import {
TestCase,
TEST_CASE_1,
TEST_CASE_10,
TEST_CASE_11,
TEST_CASE_2,
TEST_CASE_3,
TEST_CASE_4,
Expand All @@ -13,7 +15,7 @@ import {
TEST_CASE_9,
} from './test-cases';

const toStorageInp = (inp: { disks: any; blocks: any; sizes: any }) =>
const toStorageInp = (inp: TestCase) =>
[inp.disks, inp.blocks, inp.sizes] as const;

describe('Static Info', () => {
Expand Down Expand Up @@ -58,5 +60,9 @@ describe('Static Info', () => {
const output = mapToStorageLayout(...toStorageInp(TEST_CASE_10));
expect(output).to.deep.equal(TEST_CASE_10.layout);
});
it('Test Case 11', () => {
const output = mapToStorageLayout(...toStorageInp(TEST_CASE_11));
expect(output).to.deep.equal(TEST_CASE_11.layout);
});
});
});
Loading

0 comments on commit db8d49f

Please sign in to comment.