From 97f60558e66cf8ac36c59aee6a3f35ef2027a623 Mon Sep 17 00:00:00 2001 From: Julia Afeltra <30803904+jafeltra@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:45:46 -0400 Subject: [PATCH] Add a link to the FSH Online Examples repo (#142) * Add a link to the FSH Online examples repo * Make font size smaller * Make font size bigger and update GH link * A fin-tastic edit --- src/components/FSHControls.js | 28 ++++++++++++++++++------ src/tests/components/FSHControls.test.js | 14 ++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/components/FSHControls.js b/src/components/FSHControls.js index 8ce3c53..6d7e8ac 100644 --- a/src/components/FSHControls.js +++ b/src/components/FSHControls.js @@ -23,6 +23,7 @@ import { FormControlLabel, FormHelperText, Grid, + Link, MenuItem, Tooltip, TextField @@ -89,6 +90,13 @@ const useStyles = makeStyles((theme) => ({ dialogPaper: { maxHeight: '80vh', minHeight: '80vh' + }, + dialogActions: { + justifyContent: 'space-between' + }, + dialogActionsMessage: { + fontStyle: 'italic', + padding: '6px 8px' } })); @@ -423,13 +431,19 @@ export default function FSHControls(props) { - - - + +
+ Have an example that might be bene-fish-al? Seas the day and add to our collection on{' '} + GitHub! +
+
+ + +
diff --git a/src/tests/components/FSHControls.test.js b/src/tests/components/FSHControls.test.js index aff5292..04a58fb 100644 --- a/src/tests/components/FSHControls.test.js +++ b/src/tests/components/FSHControls.test.js @@ -453,6 +453,20 @@ it('should properly render the examples in the file tree', async () => { expect(manifestChild2).toBeInTheDocument(); }); +it('should include a link to the examples repo', () => { + const { getByRole, getByText } = render(, container); + + const examplesButton = getByRole('button', { name: /Examples/i }); + expect(examplesButton).toBeInTheDocument(); + fireEvent.click(examplesButton); + + const exampleRepoText = getByText(/Have an example that might be bene-fish-al?/); + expect(exampleRepoText).toBeInTheDocument(); + const exampleRepoUrl = getByRole('link'); + expect(exampleRepoUrl).toBeInTheDocument(); + expect(exampleRepoUrl).toHaveAttribute('href', 'https://github.com/FSHSchool/FSHOnline-Examples#readme'); +}); + it.skip('should populate editor when examples are collected', async () => { const updateTextValueSpy = jest.fn();