[#1526] Fix failing FileNode test

This commit is contained in:
Cassie Tarakajian 2020-08-05 18:27:38 -04:00
parent 90e81d8ddc
commit 763ee140fa
2 changed files with 2 additions and 1 deletions

View file

@ -264,6 +264,7 @@ export class FileNode extends React.Component {
aria-label={this.state.updatedName} aria-label={this.state.updatedName}
className="sidebar__file-item-name" className="sidebar__file-item-name"
onClick={this.handleFileClick} onClick={this.handleFileClick}
data-testid="file-name"
> >
<FileName name={this.state.updatedName} /> <FileName name={this.state.updatedName} />
</button> </button>

View file

@ -13,7 +13,7 @@ describe('<FileNode />', () => {
}; };
const expectFileNameToBe = async (expectedName) => { const expectFileNameToBe = async (expectedName) => {
const name = screen.getByLabelText(/Name/i); const name = screen.getByTestId('file-name');
await waitFor(() => within(name).queryByText(expectedName)); await waitFor(() => within(name).queryByText(expectedName));
}; };