Skip to content

Commit

Permalink
minor correction
Browse files Browse the repository at this point in the history
  • Loading branch information
meetulr committed Oct 27, 2024
1 parent d022c8d commit 01b4b65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/components/TagActions/TagActions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,17 @@ describe('Organisation Tags Page', () => {
userEvent.click(screen.getByTestId('expandSubTags1'));

await waitFor(() => {
expect(screen.getByTestId('subTagsScrollableDiv')).toBeInTheDocument();
expect(screen.getByTestId('subTagsScrollableDiv1')).toBeInTheDocument();
});
// Find the infinite scroll div for subtags by test ID or another selector
const subTagsScrollableDiv = screen.getByTestId('subTagsScrollableDiv');
const subTagsScrollableDiv1 = screen.getByTestId('subTagsScrollableDiv1');

const initialTagsDataLength =
screen.getAllByTestId('orgUserSubTags').length;

// Set scroll position to the bottom
fireEvent.scroll(subTagsScrollableDiv, {
target: { scrollY: subTagsScrollableDiv.scrollHeight },
fireEvent.scroll(subTagsScrollableDiv1, {
target: { scrollY: subTagsScrollableDiv1.scrollHeight },
});

await waitFor(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/TagActions/TagNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ const TagNode: React.FC<InterfaceTagNodeProps> = ({
{expanded && subTagsList && (
<div style={{ marginLeft: '20px' }}>
<div
id="subTagsScrollableDiv"
data-testid="subTagsScrollableDiv"
id={`subTagsScrollableDiv${tag._id}`}
data-testid={`subTagsScrollableDiv${tag._id}`}
style={{
height: 300,
overflow: 'auto',
Expand All @@ -176,7 +176,7 @@ const TagNode: React.FC<InterfaceTagNodeProps> = ({
<div className="spinner" />
</div>
}
scrollableTarget="subTagsScrollableDiv"
scrollableTarget={`subTagsScrollableDiv${tag._id}`}
>
{subTagsList.map((tag: InterfaceTagData) => (
<div key={tag._id} data-testid="orgUserSubTags">
Expand Down

0 comments on commit 01b4b65

Please sign in to comment.