Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Add empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad committed Nov 28, 2023
1 parent 7a0478e commit cbd1294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cypress/integration/preferences/public_key_management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ describe("Public Key Management Page", () => {
cy.dataCy("table-key-name").first().should("not.contain", keyName1);
cy.dataCy("table-key-name").first().contains(keyName2);
});
it('Displays "No keys saved. Add a new key to populate the list." when no keys are available', () => {
it("Displays empty message", () => {
cy.dataCy("delete-btn").first().click();
cy.contains("button", "Yes").click();
cy.dataCy("delete-btn").first().click();
cy.contains("button", "Yes").click();
cy.contains("No keys saved. Add a new key to populate the list.");
cy.contains("No keys saved.");
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { usePreferencesAnalytics } from "analytics";
import Popconfirm from "components/Popconfirm";
import { WordBreak } from "components/styles";
import { BaseTable } from "components/Table/BaseTable";
import { TablePlaceholder } from "components/Table/TablePlaceholder";
import { size } from "constants/tokens";
import { useToastContext } from "context/toast";
import {
Expand Down Expand Up @@ -118,6 +119,7 @@ export const PublicKeysTable: React.FC<PublicKeysTableProps> = ({
return (
<BaseTable
data-cy="hosts-table"
emptyComponent={<TablePlaceholder glyph="Key" message="No keys saved." />}
loading={loadingMyPublicKeys}
shouldAlternateRowColor
table={table}
Expand Down

0 comments on commit cbd1294

Please sign in to comment.