|
| 1 | +import CheckBox from "../../src/CheckBox.js"; |
| 2 | +import Switch from "../../src/Switch.js"; |
| 3 | +import Link from "../../src/Link.js"; |
| 4 | +import Label from "../../src/Label.js"; |
| 5 | +import Text from "../../src/Text.js"; |
| 6 | +import RatingIndicator from "../../src/RatingIndicator.js"; |
| 7 | +import StepInput from "../../src/StepInput.js"; |
| 8 | +import Button from "../../src/Button.js"; |
| 9 | +import ComboBox from "../../src/ComboBox.js"; |
| 10 | +import ComboBoxItem from "../../src/ComboBoxItem.js"; |
| 11 | +import SegmentedButtonItem from "../../src/SegmentedButtonItem.js"; |
| 12 | +import SegmentedButton from "../../src/SegmentedButton.js"; |
| 13 | +import Input from "../../src/Input.js"; |
| 14 | +import DatePicker from "../../src/DatePicker.js"; |
| 15 | +import RadioButton from "../../src/RadioButton.js"; |
| 16 | +import RangeSlider from "../../src/RangeSlider.js"; |
| 17 | +import Slider from "../../src/Slider.js"; |
| 18 | +import Select from "../../src/Select.js"; |
| 19 | +import Option from "../../src/Option.js"; |
| 20 | +import FileUploader from "../../src/FileUploader.js"; |
| 21 | + |
| 22 | +describe("Vertical Alignment", () => { |
| 23 | + it("tests container height to detect and avoid vertical misalignment", () => { |
| 24 | + cy.mount( |
| 25 | + <> |
| 26 | + <div id="container"> |
| 27 | + <Input value="value"></Input> |
| 28 | + <DatePicker value="today"></DatePicker> |
| 29 | + <SegmentedButton accessibleName="Geographic location"> |
| 30 | + <SegmentedButtonItem>Map</SegmentedButtonItem> |
| 31 | + <SegmentedButtonItem selected>Satellite</SegmentedButtonItem> |
| 32 | + </SegmentedButton> |
| 33 | + <ComboBox value="Bulgaria"> |
| 34 | + <ComboBoxItem text="Algeria" id="cbi"></ComboBoxItem> |
| 35 | + <ComboBoxItem text="Argentina"></ComboBoxItem> |
| 36 | + <ComboBoxItem text="Bosnia and Herzegovina"></ComboBoxItem> |
| 37 | + <ComboBoxItem text="Brazil"></ComboBoxItem> |
| 38 | + <ComboBoxItem text="Bulgaria"></ComboBoxItem> |
| 39 | + <ComboBoxItem text="Canada"></ComboBoxItem> |
| 40 | + <ComboBoxItem text="Chile"></ComboBoxItem> |
| 41 | + </ComboBox> |
| 42 | + <Select> |
| 43 | + <Option>Option 1</Option> |
| 44 | + <Option>Option 2</Option> |
| 45 | + <Option>Option 3</Option> |
| 46 | + </Select> |
| 47 | + </div> |
| 48 | + |
| 49 | + <div id="container2"> |
| 50 | + <CheckBox text="Check" checked></CheckBox> |
| 51 | + <Switch textOn="On" textOff="Off"></Switch> |
| 52 | + <RadioButton text="option c" checked></RadioButton> |
| 53 | + <Label>Lorem ipsum dolor sit</Label> |
| 54 | + <Text>Some text here</Text> |
| 55 | + <Button>Click Me</Button> |
| 56 | + <Link href="https://ui5webcomponents.github.io" target="_blank">Link</Link> |
| 57 | + <StepInput></StepInput> |
| 58 | + <FileUploader></FileUploader> |
| 59 | + </div> |
| 60 | + |
| 61 | + <div id="container3"> |
| 62 | + <RatingIndicator></RatingIndicator> |
| 63 | + </div> |
| 64 | + |
| 65 | + <div id="container4"> |
| 66 | + <RangeSlider id="range_slider1" style={{ width: "200px" }}></RangeSlider> |
| 67 | + <Slider id="slider1" style={{ width: "200px" }}></Slider> |
| 68 | + </div> |
| 69 | + </> |
| 70 | + ); |
| 71 | + |
| 72 | + cy.get("#container").should("have.css", "height", "44px"); |
| 73 | + cy.get("#container2").should("have.css", "height", "44px"); |
| 74 | + cy.get("#container3").should("have.css", "height", "48px"); |
| 75 | + cy.get("#container4").should("have.css", "height", "53px"); |
| 76 | + }); |
| 77 | +}); |
0 commit comments