+ const mockUpdate = jest.fn()
+ beforeEach(() => {
+ props = {
+ onCloseClick: jest.fn(),
+ cutout: 'B3',
+ requiredFixture: TRASH_BIN_LOAD_NAME,
+ }
+ mockUseUpdateDeckConfigurationMutation.mockReturnValue({
+ updateDeckConfiguration: mockUpdate,
+ } as any)
+ })
+ it('renders the correct text and button works as expected', () => {
+ const { getByText, getByRole } = render(props)
+ getByText('Add Trash Bin to deck configuration')
+ getByText(
+ 'Add this fixture to your deck configuration. It will be referenced during protocol analysis.'
+ )
+ getByText('Trash Bin')
+ getByRole('button', { name: 'Add' }).click()
+ expect(mockUpdate).toHaveBeenCalled()
+ })
+})
diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupFixtureList.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupFixtureList.test.tsx
index cf6eb1b4e43..8da24a61675 100644
--- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupFixtureList.test.tsx
+++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupFixtureList.test.tsx
@@ -8,17 +8,23 @@ import {
import { i18n } from '../../../../../i18n'
import { useLoadedFixturesConfigStatus } from '../../../../../resources/deck_configuration/hooks'
import { SetupFixtureList } from '../SetupFixtureList'
+import { NotConfiguredModal } from '../NotConfiguredModal'
import { LocationConflictModal } from '../LocationConflictModal'
import type { LoadedFixturesBySlot } from '@opentrons/api-client'
jest.mock('../../../../../resources/deck_configuration/hooks')
jest.mock('../LocationConflictModal')
+jest.mock('../NotConfiguredModal')
+
const mockUseLoadedFixturesConfigStatus = useLoadedFixturesConfigStatus as jest.MockedFunction<
typeof useLoadedFixturesConfigStatus
>
const mockLocationConflictModal = LocationConflictModal as jest.MockedFunction<
typeof LocationConflictModal
>
+const mockNotConfiguredModal = NotConfiguredModal as jest.MockedFunction<
+ typeof NotConfiguredModal
+>
const mockLoadedFixture = {
id: 'stubbed_load_fixture',
commandType: 'loadFixture',
@@ -58,6 +64,7 @@ describe('SetupFixtureList', () => {
mockLocationConflictModal.mockReturnValue(
mock location conflict modal
)
+ mockNotConfiguredModal.mockReturnValue(mock not configured modal
)
})
it('should render the headers and a fixture with configured status', () => {
@@ -92,6 +99,6 @@ describe('SetupFixtureList', () => {
const { getByText, getByRole } = render(props)[0]
getByText('Not configured')
getByRole('button', { name: 'Update deck' }).click()
- // TODO(Jr, 10/5/23): add test coverage for button
+ getByText('mock not configured modal')
})
})
diff --git a/app/src/resources/deck_configuration/hooks.ts b/app/src/resources/deck_configuration/hooks.ts
index 8388cfab084..29b853b6704 100644
--- a/app/src/resources/deck_configuration/hooks.ts
+++ b/app/src/resources/deck_configuration/hooks.ts
@@ -1,6 +1,10 @@
import { useDeckConfigurationQuery } from '@opentrons/react-api-client'
-import type { Fixture, LoadFixtureRunTimeCommand } from '@opentrons/shared-data'
+import {
+ Fixture,
+ LoadFixtureRunTimeCommand,
+ STANDARD_SLOT_LOAD_NAME,
+} from '@opentrons/shared-data'
export const CONFIGURED = 'configured'
export const CONFLICTING = 'conflicting'
@@ -32,9 +36,12 @@ export function useLoadedFixturesConfigStatus(
deckConfigurationAtLocation.loadName === loadedFixture.params.loadName
) {
configurationStatus = CONFIGURED
+ // special casing this for now until we know what the backend will give us. It is only
+ // conflicting if the current deck configuration fixture is not the desired or standard slot
} else if (
deckConfigurationAtLocation != null &&
- deckConfigurationAtLocation.loadName !== loadedFixture.params.loadName
+ deckConfigurationAtLocation.loadName !== loadedFixture.params.loadName &&
+ deckConfigurationAtLocation.loadName !== STANDARD_SLOT_LOAD_NAME
) {
configurationStatus = CONFLICTING
}