-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(protocol-designer): Fix deck view size issues in pd (#16616)
* fix(protocol-designer): Fix deck view size issues in pd
- Loading branch information
Showing
15 changed files
with
181 additions
and
57 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
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
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
21 changes: 21 additions & 0 deletions
21
protocol-designer/src/organisms/DefineLiquidsModal/__tests__/utils.test.ts
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,21 @@ | ||
import { describe, it, expect } from 'vitest' | ||
import { checkColor } from '../utils' | ||
|
||
describe('checkColor', () => { | ||
it('should return true for very dark colors', () => { | ||
expect(checkColor('#000000')).toBe(true) | ||
expect(checkColor('#0a0a0a')).toBe(true) | ||
}) | ||
|
||
it('should return true for very light colors', () => { | ||
expect(checkColor('#ffffff')).toBe(true) | ||
expect(checkColor('#f5f5f5')).toBe(true) | ||
}) | ||
|
||
it('should return false for colors with medium luminance', () => { | ||
expect(checkColor('#808080')).toBe(false) | ||
expect(checkColor('#ff0000')).toBe(false) | ||
expect(checkColor('#00ff00')).toBe(false) | ||
expect(checkColor('#0000ff')).toBe(false) | ||
}) | ||
}) |
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
25 changes: 25 additions & 0 deletions
25
protocol-designer/src/organisms/SlotDetailsContainer/__tests__/utils.test.ts
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,25 @@ | ||
import { describe, it, expect } from 'vitest' | ||
import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data' | ||
import { getXPosition } from '../utils' | ||
|
||
describe('getXPosition', () => { | ||
it('should return the right position 600 for FLEX robot type and slot 3', () => { | ||
expect(getXPosition('3', FLEX_ROBOT_TYPE, false)).toBe('600') | ||
}) | ||
|
||
it('should return the right position 700 for FLEX robot type and slot 4', () => { | ||
expect(getXPosition('4', FLEX_ROBOT_TYPE, true)).toBe('700') | ||
}) | ||
|
||
it('should return the left position for FLEX robot type and slot 1', () => { | ||
expect(getXPosition('1', FLEX_ROBOT_TYPE, false)).toBe('-400') | ||
}) | ||
|
||
it('should return the right position for OT2 robot type and slot 6', () => { | ||
expect(getXPosition('6', OT2_ROBOT_TYPE, false)).toBe('420') | ||
}) | ||
|
||
it('should return the left position for OT2 robot type and slot 2', () => { | ||
expect(getXPosition('2', OT2_ROBOT_TYPE, false)).toBe('-300') | ||
}) | ||
}) |
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
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
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
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
Oops, something went wrong.