Skip to content

Commit

Permalink
RS-554: Add hard quota to bucket settings (#72)
Browse files Browse the repository at this point in the history
* add hard quota to bucket settings

* update CHANGELOG
  • Loading branch information
atimin authored Dec 16, 2024
1 parent fa60b07 commit 66db2d6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- RS-554: add forgotten HARD quota type to bucket settings, [PR-72](https://github.com/reductstore/web-console/pull/72)

## [1.8.0] - 2024-11-06

### Added
Expand Down
26 changes: 26 additions & 0 deletions src/Components/Bucket/BucketSettingsForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,30 @@ describe("Bucket::BucketSettingsForm", () => {
const inputEditable = wrapperEditable.find("#InputName").at(0);
expect(inputEditable.props().disabled).toBeFalsy();
});

it.each(["NONE", "FIFO", "HARD"])(
"should show all available quota types",
async (quotaType: string) => {
bucket.getSettings = jest.fn().mockResolvedValue({
maxBlockSize: 64_000_001n,
maxBlockRecords: 1024,
quotaSize: 1000n,
quotaType: QuotaType[quotaType as keyof typeof QuotaType],
});

const wrapper = mount(
<BucketSettingsForm
showAll
client={client}
bucketName={"bucket"}
onCreated={() => console.log("")}
/>,
);

await waitUntilFind(wrapper, { name: "quotaType" });
const input = wrapper.find({ name: "quotaType" }).at(0);
console.log(input.debug());
expect(input.props().initialValue).toEqual(quotaType);
},
);
});
1 change: 1 addition & 0 deletions src/Components/Bucket/BucketSettingsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ class BucketSettingsForm extends React.Component<
<Select>
<Option value="NONE">NONE</Option>
<Option value="FIFO">FIFO</Option>
<Option value="HARD">HARD</Option>
</Select>
</Form.Item>
<Form.Item
Expand Down

0 comments on commit 66db2d6

Please sign in to comment.