-
Notifications
You must be signed in to change notification settings - Fork 4
Tbt/fix frontend linter #1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Tbt/fix frontend linter #1061
Conversation
| ); | ||
|
|
||
| const [isPaginated, setIsPaginated] = useState(false); | ||
| const isPaginated = useRef(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm struggling to understand the whole pagination system, but I'm not sure that this can just be substituted like this - previously, the state and its setter got passed down to the WorkflowsContent and it got changed from there, but now I think the isPaginated.current value would only be passed down when the component renders and any changes to isPaginatedRef in the WorkflowsContent won't be seen back here. This seems to start false, get set to true in the useEffect, then have no way of changing back.
I had a bit of a play around with this in the browser and I didn't see any faulty behaviour, so it's possible that the dependencies and re-rendering of components happens to make this irrelevant, but I do think this could use a bit of a closer look. Sorry I can't be any more specific than that...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree with this. Have added a callback to allow the bi-directional data flow
75cbaeb to
7e19b8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to make some changes to ScrollableImages but I'll make those changes to SciReactUI and import the component here when done.
3dbe4e2 to
dbaf042
Compare
| expect(screen.getByText("React Flow")).toBeVisible(); | ||
| expect(screen.getByText("even")).toBeInTheDocument(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will just point out this, as it's something Thomas and I changed to get the test passing, but maybe we shouldn't have: the even node always counts as being in the document, regardless of whether the accordion is expanded or not, thus making this check redundant. I've tried getting it to work with toBeVisible again but no luck.
Perhaps we should change the test to something like this, just to make it a bit less misleading?
it("should contain a Flow with job nodes", async () => {
const accordionButton = await screen.findByRole("button", {
name: /conditional-steps-first/i,
});
expect(accordionButton).toHaveAttribute("aria-expanded", "false");
expect(screen.getByText("React Flow")).not.toBeVisible();
expect(screen.getByText("even")).toBeInTheDocument();
await user.click(accordionButton);
expect(accordionButton).toHaveAttribute("aria-expanded", "true");
expect(screen.getByText("React Flow")).toBeVisible();
});The above also seems to work without the hacky script I introduced in relay-workflows-lib/tests/mocks/mockReactFlow.ts, so that could be binned
dbaf042 to
d7d60b9
Compare
No description provided.