vault/ui/tests/pages/components/flash-message.js
Vault Automation 0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00

34 lines
846 B
JavaScript

/**
* Copyright IBM Corp. 2016, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
import { waitFor, settled } from '@ember/test-helpers';
import { collection, text, clickable } from 'ember-cli-page-object';
import { getter } from 'ember-cli-page-object/macros';
export default {
latestMessage: getter(function () {
return this.latestItem.text;
}),
latestItem: getter(function () {
const count = this.messages.length;
return this.messages.objectAt(count - 1);
}),
messages: collection('[data-test-flash-message-body]', {
click: clickable(),
text: text(),
}),
waitForFlash() {
return waitFor('[data-test-flash-message-body]');
},
clickLast() {
return this.latestItem.click();
},
async clickAll() {
for (const message of this.messages) {
message.click();
}
await settled();
},
};