Skip to content

Commit

Permalink
fixed flows table row test
Browse files Browse the repository at this point in the history
  • Loading branch information
geakstr committed Jul 24, 2023
1 parent 5e282b5 commit 37e05a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/FlowsTable/__tests__/Row.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const runTemporalTests = (row: HTMLElement, flow: Flow) => {
jest.clearAllTimers();
const flowTime = new Date(flow.millisecondsTimestamp || Date.now());

const tsLabel = row.querySelector('.cell:nth-child(11)')!;
const tsLabel = row.querySelector('.cell:nth-child(12)')!;

// Just checks that tsLabel contains smth
jest.advanceTimersByTime(0);
Expand Down
10 changes: 7 additions & 3 deletions src/components/ServiceMapArrowRenderer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const ServiceMapArrowRenderer = observer(
const padlocks = d3
.select(innerArrows.current!)
.selectAll<SVGTextElement, AccessPointArrow>('text.padlock')
.data(apArrows, arr => `inner-${arr.id}`);
.data(apArrows, arr => `padlock-${arr.id}`);

backgroundLines.call(self =>
helpers.innerArrows.setPosition(self, arrow.end!),
Expand Down Expand Up @@ -180,6 +180,10 @@ export const ServiceMapArrowRenderer = observer(
.style('padding', '1px 3px')
.text('Mutual auth enabled');

padlocks
.attr('x', () => arrow.end!.x - 8)
.attr('y', () => arrow.end!.y - 20);

padlocks
.enter()
.append('text')
Expand All @@ -189,8 +193,8 @@ export const ServiceMapArrowRenderer = observer(
.attr('color', a =>
a.isEncrypted ? colors.padlockGreen : colors.feetNeutralStroke,
)
.attr('x', arrow.end.x - 8)
.attr('y', arrow.end.y - 20)
.attr('x', () => arrow.end!.x - 8)
.attr('y', () => arrow.end!.y - 20)
.text((arrow: AccessPointArrow) => (arrow.hasAuth ? '\uf232' : ''))
.on('mouseover', () => padlockTooltip.style('visibility', 'visible'))
.on('mousemove', evt => {
Expand Down

0 comments on commit 37e05a8

Please sign in to comment.