Skip to content

Commit

Permalink
test(28773): fix mocks and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d authored and DC2-DanielKrueger committed Dec 10, 2024
1 parent 4096cd4 commit 0b3a0fc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion hivemq-edge/src/frontend/src/__test-utils__/adapters/mqtt.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export const MOCK_MAX_QOS = -500
import { QoS } from '@/api/__generated__'

export const MOCK_MAX_QOS = QoS.AT_MOST_ONCE
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { MOCK_MAX_QOS } from '@/__test-utils__/adapters/mqtt.ts'
export const MOCK_SOUTHBOUND_MAPPING: SouthboundMapping = {
topicFilter: 'my/filter',
tagName: 'my/tag',
maxQoS: MOCK_MAX_QOS,
fieldMapping: {
instructions: [{ source: 'dropped-property', destination: 'lastName' }],
metadata: { destination: GENERATE_DATA_MODELS(true, 'my/filter'), source: GENERATE_DATA_MODELS(true, 'my/tag') },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { renderHook, waitFor } from '@testing-library/react'

import { server } from '@/__test-utils__/msw/mockServer.ts'
import { SimpleWrapper as wrapper } from '@/__test-utils__/hooks/SimpleWrapper.tsx'
import { MOCK_MAX_QOS } from '@/__test-utils__/adapters/mqtt.ts'
import { mappingHandlers } from '@/api/hooks/useProtocolAdapters/__handlers__/mapping.mocks.ts'
import { useListSouthboundMappings } from '@/api/hooks/useProtocolAdapters/useListSouthboundMappings.ts'

Expand All @@ -26,7 +25,6 @@ describe('useListSouthboundMappings', () => {
expect.objectContaining({
topicFilter: 'my/filter',
tagName: 'my/tag',
maxQoS: MOCK_MAX_QOS,
}),
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { SimpleWrapper as wrapper } from '@/__test-utils__/hooks/SimpleWrapper.t
import { useSouthboundMappingManager } from '@/modules/Mappings/hooks/useSouthboundMappingManager.ts'
import { mappingHandlers } from '@/api/hooks/useProtocolAdapters/__handlers__/mapping.mocks.ts'
import { type FieldMapping, SouthboundMappingList } from '@/api/__generated__'
import { MOCK_MAX_QOS } from '@/__test-utils__/adapters/mqtt.ts'

describe('useSouthboundMappingManager', () => {
beforeEach(() => {
Expand All @@ -27,7 +26,6 @@ describe('useSouthboundMappingManager', () => {
expect(result.current.data).toStrictEqual<SouthboundMappingList>({
items: [
expect.objectContaining({
maxQoS: MOCK_MAX_QOS,
tagName: 'my/tag',
topicFilter: 'my/filter',
fieldMapping: expect.objectContaining<FieldMapping>({
Expand Down

0 comments on commit 0b3a0fc

Please sign in to comment.