Skip to content

Commit

Permalink
Merge branch 'master' into separate-loggers-and-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
jafeltra authored Sep 20, 2023
2 parents a710603 + 97f6055 commit ccbb1c5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/components/FSHControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
FormControlLabel,
FormHelperText,
Grid,
Link,
MenuItem,
Tooltip,
TextField
Expand Down Expand Up @@ -89,6 +90,13 @@ const useStyles = makeStyles((theme) => ({
dialogPaper: {
maxHeight: '80vh',
minHeight: '80vh'
},
dialogActions: {
justifyContent: 'space-between'
},
dialogActionsMessage: {
fontStyle: 'italic',
padding: '6px 8px'
}
}));

Expand Down Expand Up @@ -423,13 +431,19 @@ export default function FSHControls(props) {
</Grid>
</Grid>
</DialogContent>
<DialogActions>
<Button onClick={handleCopyToClipboard} color="primary">
<AssignmentOutlinedIcon></AssignmentOutlinedIcon> Copy to clipboard
</Button>
<Button onClick={handleCloseExamples} color="secondary">
Close
</Button>
<DialogActions className={classes.dialogActions}>
<div className={classes.dialogActionsMessage}>
Have an example that might be bene-fish-al? Seas the day and add to our collection on{' '}
<Link href="https://github.com/FSHSchool/FSHOnline-Examples#readme">GitHub</Link>!
</div>
<div>
<Button onClick={handleCopyToClipboard} color="primary">
<AssignmentOutlinedIcon></AssignmentOutlinedIcon> Copy to clipboard
</Button>
<Button onClick={handleCloseExamples} color="secondary">
Close
</Button>
</div>
</DialogActions>
</Dialog>
</Box>
Expand Down
14 changes: 14 additions & 0 deletions src/tests/components/FSHControls.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(<FSHControls exampleConfig={[]} />, 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();

Expand Down

0 comments on commit ccbb1c5

Please sign in to comment.