Skip to content

Commit 8fa9df2

Browse files
authored
fix: Add backward compatibility for expandable table test util (#3667)
1 parent afdbe00 commit 8fa9df2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test-utils/dom/table/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ export default class TableWrapper extends ComponentWrapper {
177177
* @param rowIndex 1-based index of the row.
178178
*/
179179
findExpandToggle(rowIndex: number): ElementWrapper | null {
180-
return this.findNativeTable().find(`tbody tr:nth-child(${rowIndex}) .${expandToggleStyles['expand-toggle']}`);
180+
// the file was moved, which changed the hash, so we cannot use old test class anymore.
181+
const oldSelector = `tbody tr:nth-child(${rowIndex}) .awsui_expand-toggle_1ss49_1w02f_153`;
182+
const newSelector = `tbody tr:nth-child(${rowIndex}) .${expandToggleStyles['expand-toggle']}`;
183+
return this.findNativeTable().findAny(oldSelector, newSelector);
181184
}
182185

183186
/**

0 commit comments

Comments
 (0)