-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Taylor Grafft
authored and
Taylor Grafft
committed
Oct 5, 2023
1 parent
41b0f80
commit 00f4c5c
Showing
3 changed files
with
49 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
display: flex; | ||
align-items: center; | ||
gap: 1rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
client/src/components/DataFiles/DataFilesDropdown/DataFilesDropdown.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { fireEvent } from '@testing-library/react'; | ||
import configureMockStore from 'redux-mock-store'; | ||
import renderComponent from 'utils/testing'; | ||
import systemsFixture from '../fixtures/DataFiles.systems.fixture'; | ||
import BreadcrumbsDropdown from './DataFilesDropdown'; | ||
|
||
const mockStore = configureMockStore(); | ||
|
||
describe('BreadcrumbsDropdown', () => { | ||
it('renders "Go to ..." dropdown and can be toggled', () => { | ||
const store = mockStore({ | ||
systems: systemsFixture, | ||
}); | ||
|
||
const { getByText } = renderComponent( | ||
<BreadcrumbsDropdown | ||
api="tapis" | ||
scheme="private" | ||
system="frontera.home.username" | ||
path="/path/to/files" | ||
/>, | ||
store | ||
); | ||
|
||
const dropdownToggle = getByText('Go to ...'); | ||
expect(dropdownToggle).toBeDefined(); | ||
|
||
// Toggle dropdown | ||
fireEvent.click(dropdownToggle); | ||
|
||
// Now, dropdown content should be visible | ||
expect(getByText('Root')).toBeDefined(); | ||
}); | ||
}); |