Skip to content

Commit

Permalink
test selector things
Browse files Browse the repository at this point in the history
  • Loading branch information
Monkeychip committed Oct 16, 2024
1 parent b87b0a6 commit acacc37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ module('Acceptance | kv-v2 workflow | navigation', function (hooks) {
.dom(PAGE.breadcrumbAtIdx(1))
.hasText(this.backend, 'breadcrumb before secret path is backend path');
assert
.dom(PAGE.breadcrumbAtValue(pathWithSpace))
.exists('the current breadcrumb is value of the secret path');
.dom(PAGE.breadcrumbCurrentAtIdx(2))
.hasText('per%centfu ll', 'the current breadcrumb is value of the secret path');

await click(PAGE.breadcrumbAtIdx(1));
assert
Expand Down Expand Up @@ -176,7 +176,9 @@ module('Acceptance | kv-v2 workflow | navigation', function (hooks) {
'title is of the full nested path (directory included) without any encoding/decoding.'
);
assert.dom(PAGE.breadcrumbAtIdx(2)).hasText('per%');
assert.dom(PAGE.breadcrumbAtValue('centfu ll')).exists('the current breadcrumb is value centfu ll');
assert
.dom(PAGE.breadcrumbCurrentAtIdx(3))
.hasText('centfu ll', 'the current breadcrumb is value centfu ll');

await click(PAGE.breadcrumbAtIdx(1));
assert
Expand Down Expand Up @@ -218,7 +220,7 @@ module('Acceptance | kv-v2 workflow | navigation', function (hooks) {
assert
.dom(PAGE.breadcrumbAtIdx(3))
.hasText('foo%2fbar', 'foo%2fbar is the second directory and shows up as a separate breadcrumb');
assert.dom(PAGE.breadcrumbAtValue('world')).exists('the current breadcrumb is value world');
assert.dom(PAGE.breadcrumbCurrentAtIdx(4)).hasText('world', 'the current breadcrumb is value world');

await click(PAGE.breadcrumbAtIdx(2));
assert
Expand Down
3 changes: 2 additions & 1 deletion ui/tests/helpers/kv/kv-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const PAGE = {
breadcrumbs: '[data-test-breadcrumbs]',
breadcrumb: '[data-test-breadcrumbs] li',
breadcrumbAtIdx: (idx) => `[data-test-breadcrumbs] li:nth-child(${idx + 1}) a`,
breadcrumbAtValue: (value) => `[data-test-breadcrumb="${value}"]`,
breadcrumbCurrentAtIdx: (idx) =>
`[data-test-breadcrumbs] li:nth-child(${idx + 1}) .hds-breadcrumb__current`,
infoRow: '[data-test-component="info-table-row"]',
infoRowValue: (label) => `[data-test-value-div="${label}"]`,
infoRowToggleMasked: (label) => `[data-test-value-div="${label}"] [data-test-button="toggle-masked"]`,
Expand Down

0 comments on commit acacc37

Please sign in to comment.