mirror of
https://github.com/prymitive/karma
synced 2026-05-11 03:46:48 +00:00
feat(ui): show username when auth is enabled
This commit is contained in:
@@ -81,6 +81,11 @@ const MainModalContent = observer(
|
||||
) : null}
|
||||
</div>
|
||||
<div className="modal-footer">
|
||||
{alertStore.info.authentication.enabled && (
|
||||
<span className="text-muted mr-2">
|
||||
Username: {alertStore.info.authentication.username}
|
||||
</span>
|
||||
)}
|
||||
<span className="text-muted">
|
||||
Version: {alertStore.info.version}
|
||||
</span>
|
||||
|
||||
@@ -96,4 +96,22 @@ describe("<MainModalContent />", () => {
|
||||
it("calls setTab('help') after clicking on the 'Help' tab", () => {
|
||||
ValidateSetTab("Help", "help");
|
||||
});
|
||||
|
||||
it("shows username when alertStore.info.authentication.enabled=true", () => {
|
||||
alertStore.info.authentication.enabled = true;
|
||||
alertStore.info.authentication.username = "me@example.com";
|
||||
const tree = mount(
|
||||
<span>
|
||||
{Wrapped(
|
||||
<MainModalContent
|
||||
alertStore={alertStore}
|
||||
settingsStore={settingsStore}
|
||||
onHide={onHide}
|
||||
expandAllOptions={true}
|
||||
/>
|
||||
)}
|
||||
</span>
|
||||
);
|
||||
expect(tree.text()).toMatch(/Username: me@example.com/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user