test: Refactoring toolbar data-cy selectors (#1323)
This commit is contained in:
1 parent
e1142910e4
commit
d6d92afbda
6 files changed
+44
-55
No files matched your search
@@ -43,6 +43,7 @@ const renderTabsHeader = (tabs, activeTabIndex, onHeaderChanged) => {
|
||||
? tabs.map((tab, index) => {
|
||||
const { name, hidden = false } = tab;
|
||||
|
||||
const cypressSelectorId = name.toLowerCase();
|
||||
const tabClass =
|
||||
index === activeTabIndex ? 'nav-link active' : 'nav-link';
|
||||
return !hidden ? (
|
||||
@@ -52,6 +53,7 @@ const renderTabsHeader = (tabs, activeTabIndex, onHeaderChanged) => {
|
||||
onHeaderChanged(index);
|
||||
}}
|
||||
className={tabClass}
|
||||
data-cy={cypressSelectorId}
|
||||
>
|
||||
<button>{name}</button>
|
||||
</li>
|
||||
|
||||
@@ -23,8 +23,14 @@ export function ToolbarButton(props) {
|
||||
}
|
||||
};
|
||||
|
||||
const cypressSelectorId = props.label.toLowerCase();
|
||||
|
||||
return (
|
||||
<div className={className} onClick={handleClick}>
|
||||
<div
|
||||
className={className}
|
||||
onClick={handleClick}
|
||||
data-cy={cypressSelectorId}
|
||||
>
|
||||
{iconProps && <Icon {...iconProps} />}
|
||||
<div className="toolbar-button-label">
|
||||
{t(label)}
|
||||
|
||||
Reference in new issue
Block a user