Skip to content

Commit

Permalink
feat: support raid 0 in storage widget
Browse files Browse the repository at this point in the history
- refactor storage layout to represent new information
- update tests (& delete obsolete ones) to fit the new layout

BREAKING CHANGE: storage layout changed, so config options will no longer work the way they did
before
fixes #295
  • Loading branch information
MauriceNino committed Mar 1, 2023
1 parent b75745a commit 634aed5
Show file tree
Hide file tree
Showing 8 changed files with 2,021 additions and 2,673 deletions.
25 changes: 8 additions & 17 deletions apps/api/__TESTS__/dynamic-info.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ import {
TEST_CASE_10,
TEST_CASE_11,
TEST_CASE_12,
TEST_CASE_13,
TEST_CASE_14,
TEST_CASE_15,
TEST_CASE_16,
TEST_CASE_17,
TEST_CASE_18,
TEST_CASE_2,
TEST_CASE_3,
TEST_CASE_4,
TEST_CASE_5,
TEST_CASE_6,
TEST_CASE_7,
TEST_CASE_8,
TEST_CASE_9,
} from './test-cases';

const toStorageInp = (inp: TestCase) =>
Expand Down Expand Up @@ -87,13 +86,6 @@ describe('Dynamic Info', () => {
).getMappedLayout();
expect(output).to.deep.equal(TEST_CASE_8.output);
});
it('Test Case 9', () => {
const output = new DynamicStorageMapper(
false,
...toStorageInp(TEST_CASE_9)
).getMappedLayout();
expect(output).to.deep.equal(TEST_CASE_9.output);
});
it('Test Case 10', () => {
const output = new DynamicStorageMapper(
false,
Expand All @@ -115,14 +107,6 @@ describe('Dynamic Info', () => {
).getMappedLayout();
expect(output).to.deep.equal(TEST_CASE_12.output);
});
it('Test Case 13', () => {
CONFIG.running_in_docker = false;
const output = new DynamicStorageMapper(
false,
...toStorageInp(TEST_CASE_13)
).getMappedLayout();
expect(output).to.deep.equal(TEST_CASE_13.output);
});
it('Test Case 14', () => {
const output = new DynamicStorageMapper(
false,
Expand Down Expand Up @@ -153,5 +137,12 @@ describe('Dynamic Info', () => {
).getMappedLayout();
expect(output).to.deep.equal(TEST_CASE_17.output);
});
it('Test Case 18', () => {
const output = new DynamicStorageMapper(
false,
...toStorageInp(TEST_CASE_18)
).getMappedLayout();
expect(output).to.deep.equal(TEST_CASE_18.output);
});
});
});
16 changes: 5 additions & 11 deletions apps/api/__TESTS__/static-info.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ import {
TEST_CASE_10,
TEST_CASE_11,
TEST_CASE_12,
TEST_CASE_13,
TEST_CASE_14,
TEST_CASE_15,
TEST_CASE_16,
TEST_CASE_17,
TEST_CASE_18,
TEST_CASE_2,
TEST_CASE_3,
TEST_CASE_4,
TEST_CASE_5,
TEST_CASE_6,
TEST_CASE_7,
TEST_CASE_8,
TEST_CASE_9,
} from './test-cases';

const toStorageInp = (inp: TestCase) =>
Expand Down Expand Up @@ -63,10 +62,6 @@ describe('Static Info', () => {
const output = mapToStorageLayout(false, ...toStorageInp(TEST_CASE_8));
expect(output).to.deep.equal(TEST_CASE_8.layout);
});
it('Test Case 9', () => {
const output = mapToStorageLayout(false, ...toStorageInp(TEST_CASE_9));
expect(output).to.deep.equal(TEST_CASE_9.layout);
});
it('Test Case 10', () => {
const output = mapToStorageLayout(false, ...toStorageInp(TEST_CASE_10));
expect(output).to.deep.equal(TEST_CASE_10.layout);
Expand All @@ -79,11 +74,6 @@ describe('Static Info', () => {
const output = mapToStorageLayout(false, ...toStorageInp(TEST_CASE_12));
expect(output).to.deep.equal(TEST_CASE_12.layout);
});
it('Test Case 13', () => {
CONFIG.running_in_docker = false;
const output = mapToStorageLayout(false, ...toStorageInp(TEST_CASE_13));
expect(output).to.deep.equal(TEST_CASE_13.layout);
});
it('Test Case 14', () => {
const output = mapToStorageLayout(false, ...toStorageInp(TEST_CASE_14));
expect(output).to.deep.equal(TEST_CASE_14.layout);
Expand All @@ -102,5 +92,9 @@ describe('Static Info', () => {
const output = mapToStorageLayout(false, ...toStorageInp(TEST_CASE_17));
expect(output).to.deep.equal(TEST_CASE_17.layout);
});
it('Test Case 18', () => {
const output = mapToStorageLayout(false, ...toStorageInp(TEST_CASE_18));
expect(output).to.deep.equal(TEST_CASE_18.layout);
});
});
});
Loading

0 comments on commit 634aed5

Please sign in to comment.