@spothero/ui 15.1.0 → 15.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -18
- package/package.json +2 -3
- package/styles/v2/components/Modal/styles/dialogContainer.js +0 -1
- package/styles/v2/components/Radio/Radio.jsx +1 -1
- package/styles/v2/components/Radio/RadioGroup.jsx +1 -1
- package/v2/index.js +1 -1
- package/v2/index.js.map +1 -1
- package/styles/Alert/Alert.jsx +0 -45
- package/styles/Alert/Alert.spec.js +0 -85
- package/styles/AutoSuggestInput/AutoSuggestInput.jsx +0 -429
- package/styles/AutoSuggestInput/AutoSuggestInput.spec.js +0 -132
- package/styles/AutoSuggestInput/AutoSuggestItem.jsx +0 -61
- package/styles/AutoSuggestInput/AutoSuggestList.jsx +0 -85
- package/styles/Badge/Badge.jsx +0 -24
- package/styles/Badge/Badge.spec.js +0 -43
- package/styles/Chart/Chart.jsx +0 -185
- package/styles/Chart/Chart.spec.js +0 -369
- package/styles/Checkbox/Checkbox.jsx +0 -159
- package/styles/Checkbox/Checkbox.spec.js +0 -142
- package/styles/DateTime/DatePicker.jsx +0 -281
- package/styles/DateTime/DatePicker.spec.js +0 -186
- package/styles/DateTime/DatePickerCalendar.jsx +0 -170
- package/styles/DateTime/DatePickerCalendarNavigation.jsx +0 -44
- package/styles/DateTime/DatePickerCalendarWithRange.jsx +0 -218
- package/styles/DateTime/DateTimePicker.jsx +0 -266
- package/styles/DateTime/DateTimePicker.spec.js +0 -60
- package/styles/DateTime/DateTimeRangePicker.jsx +0 -629
- package/styles/DateTime/DateTimeRangePicker.spec.js +0 -425
- package/styles/DateTime/TimePicker.jsx +0 -158
- package/styles/DateTime/TimePicker.spec.js +0 -148
- package/styles/DateTime/date-time-assertions.js +0 -89
- package/styles/DateTime/index.js +0 -6
- package/styles/ErrorBoundary/ErrorBoundary.jsx +0 -76
- package/styles/ErrorBoundary/ErrorBoundary.spec.js +0 -72
- package/styles/Flyout/Flyout.jsx +0 -147
- package/styles/Flyout/Flyout.spec.js +0 -117
- package/styles/Form/Form.jsx +0 -151
- package/styles/Form/Form.spec.js +0 -148
- package/styles/Form/FormElementError.jsx +0 -18
- package/styles/Form/FormGroup.jsx +0 -32
- package/styles/Form/FormGroupError.jsx +0 -24
- package/styles/Form/index.js +0 -4
- package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +0 -215
- package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.spec.js +0 -213
- package/styles/GooglePlacesSearchInput/PoweredByGoogle.jsx +0 -43
- package/styles/GooglePlacesSearchInput/index.js +0 -2
- package/styles/HorizontalRule/HorizontalRule.jsx +0 -36
- package/styles/HorizontalRule/HorizontalRule.spec.js +0 -94
- package/styles/Label/Label.jsx +0 -22
- package/styles/Label/Label.spec.js +0 -11
- package/styles/Notification/Notification.jsx +0 -117
- package/styles/Notification/Notification.spec.js +0 -154
- package/styles/Notification/NotificationContainer.jsx +0 -90
- package/styles/Notification/NotificationPropTypes.js +0 -20
- package/styles/Notification/index.js +0 -2
- package/styles/PasswordControl/PasswordControl.jsx +0 -197
- package/styles/PasswordControl/PasswordControl.spec.js +0 -236
- package/styles/Portal/Portal.jsx +0 -65
- package/styles/Portal/Portal.spec.js +0 -45
- package/styles/PulseLoader/PulseLoader.jsx +0 -71
- package/styles/PulseLoader/PulseLoader.spec.js +0 -63
- package/styles/Radio/Radio.jsx +0 -114
- package/styles/Radio/Radio.spec.js +0 -128
- package/styles/Radio/RadioGroup.jsx +0 -105
- package/styles/Radio/index.js +0 -2
- package/styles/RenderInBody/RenderInBody.jsx +0 -56
- package/styles/RenderInBody/RenderInBody.spec.js +0 -24
- package/styles/Select/Select.jsx +0 -251
- package/styles/Select/Select.spec.js +0 -254
- package/styles/Select/SelectItemPropTypes.js +0 -19
- package/styles/Select/index.js +0 -2
- package/styles/SelectControlled/SelectControlled.jsx +0 -250
- package/styles/SelectControlled/SelectControlled.spec.js +0 -290
- package/styles/SelectControlled/index.js +0 -1
- package/styles/Sprite/Sprite.jsx +0 -16
- package/styles/Sprite/Sprite.spec.js +0 -11
- package/styles/Tabs/Tab.jsx +0 -38
- package/styles/Tabs/TabContent.jsx +0 -46
- package/styles/Tabs/TabNavigation.jsx +0 -64
- package/styles/Tabs/TabPanel.jsx +0 -30
- package/styles/Tabs/Tabs.jsx +0 -87
- package/styles/Tabs/Tabs.spec.js +0 -201
- package/styles/Tabs/index.js +0 -5
- package/styles/TextArea/TextArea.jsx +0 -137
- package/styles/TextArea/TextArea.spec.js +0 -111
- package/styles/TextInput/TextInput.jsx +0 -159
- package/styles/TextInput/TextInput.spec.js +0 -263
- package/styles/TextInput/TextInputPropTypes.js +0 -88
- package/styles/TextInput/index.js +0 -2
- package/styles/Tooltip/Tooltip.jsx +0 -230
- package/styles/Tooltip/Tooltip.spec.js +0 -170
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
describe('<Tooltip />', () => {
|
|
2
|
-
context('Display', () => {
|
|
3
|
-
context('Default', () => {
|
|
4
|
-
it('Triggers and renders properly', () => {
|
|
5
|
-
cy.visitStory('v1/Tooltip/Display', 'Default')
|
|
6
|
-
.get('.Tooltip')
|
|
7
|
-
.should('not.exist')
|
|
8
|
-
.get('.Tooltip-example')
|
|
9
|
-
.click()
|
|
10
|
-
.get('.Tooltip')
|
|
11
|
-
.should('exist')
|
|
12
|
-
.contains('This is an example tooltip with some copy.')
|
|
13
|
-
// check that close button works
|
|
14
|
-
.get('.Tooltip-close')
|
|
15
|
-
.click()
|
|
16
|
-
.wait(250)
|
|
17
|
-
.get('.Tooltip')
|
|
18
|
-
.should('not.exist');
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
context('Custom Class', () => {
|
|
23
|
-
it('Appends custom classes to Tooltip and container', () => {
|
|
24
|
-
cy.visitStory('v1/Tooltip/Display', 'CustomClass')
|
|
25
|
-
.get('.Tooltip-example')
|
|
26
|
-
.click()
|
|
27
|
-
// check that tooltip arrow has been adjusted
|
|
28
|
-
.get('.Tooltip-arrow')
|
|
29
|
-
.should('have.attr', 'style')
|
|
30
|
-
.get('.Tooltip')
|
|
31
|
-
.should('have.class', 'custom-class1')
|
|
32
|
-
.and('have.class', 'custom-class2')
|
|
33
|
-
.parent()
|
|
34
|
-
.should('have.class', 'custom-container-class1')
|
|
35
|
-
.and('have.class', 'custom-container-class2');
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
context('Without Close Button', () => {
|
|
40
|
-
it('Renders without a close button and closes on body click', () => {
|
|
41
|
-
cy.visitStory('v1/Tooltip/Display', 'WithoutCloseButton')
|
|
42
|
-
.get('.Tooltip-example')
|
|
43
|
-
.click()
|
|
44
|
-
.get('.Tooltip')
|
|
45
|
-
.should('have.class', 'Tooltip-no-close')
|
|
46
|
-
.find('.Tooltip-close')
|
|
47
|
-
.should('not.exist')
|
|
48
|
-
.get('body')
|
|
49
|
-
.click()
|
|
50
|
-
// wait for Tooltip to animate away before checking that it's gone
|
|
51
|
-
.wait(250)
|
|
52
|
-
.get('.Tooltip')
|
|
53
|
-
.should('not.exist');
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
context('Without Adjusted Arrow', () => {
|
|
58
|
-
it('Renders without making style adjustments to the tooltip arrow', () => {
|
|
59
|
-
cy.visitStory('v1/Tooltip/Display', 'WithoutAdjustArrow')
|
|
60
|
-
.get('.Tooltip-example')
|
|
61
|
-
.click()
|
|
62
|
-
.get('.Tooltip-arrow')
|
|
63
|
-
.should('not.have.attr', 'style');
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
context('Position', () => {
|
|
69
|
-
context('Top', () => {
|
|
70
|
-
it('Correctly positions the tooltip between the top of the window and trigger', () => {
|
|
71
|
-
cy.visitStory('v1/Tooltip/Position', 'Top')
|
|
72
|
-
.get('.Tooltip-example')
|
|
73
|
-
.click()
|
|
74
|
-
.get('.Tooltip')
|
|
75
|
-
.should('have.class', 'Tooltip-top');
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
context('Right', () => {
|
|
80
|
-
it('Correctly positions the tooltip between the right of the window and trigger', () => {
|
|
81
|
-
cy.visitStory('v1/Tooltip/Position', 'Right')
|
|
82
|
-
.get('.Tooltip-example')
|
|
83
|
-
.click()
|
|
84
|
-
.get('.Tooltip')
|
|
85
|
-
.should('have.class', 'Tooltip-right');
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
context('Bottom', () => {
|
|
90
|
-
it('Correctly positions the tooltip between the bottom of the window and trigger', () => {
|
|
91
|
-
cy.visitStory('v1/Tooltip/Position', 'Bottom')
|
|
92
|
-
.get('.Tooltip-example')
|
|
93
|
-
.click()
|
|
94
|
-
.get('.Tooltip')
|
|
95
|
-
.should('have.class', 'Tooltip-bottom');
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
context('Left', () => {
|
|
100
|
-
it('Correctly positions the tooltip between the left of the window and trigger', () => {
|
|
101
|
-
cy.visitStory('v1/Tooltip/Position', 'Left')
|
|
102
|
-
.get('.Tooltip-example')
|
|
103
|
-
.click()
|
|
104
|
-
.get('.Tooltip')
|
|
105
|
-
.should('have.class', 'Tooltip-left');
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
context('Tip Offset', () => {
|
|
110
|
-
it('Correctly positions the tooltip arrow a specified distance from the trigger', () => {
|
|
111
|
-
let triggerRight;
|
|
112
|
-
let tooltipLeft;
|
|
113
|
-
|
|
114
|
-
cy.visitStory('v1/Tooltip/Position', 'TipOffset')
|
|
115
|
-
.get('.Tooltip-example')
|
|
116
|
-
.click()
|
|
117
|
-
.get('.Tooltip-example')
|
|
118
|
-
.then($el => {
|
|
119
|
-
triggerRight = $el[0].getBoundingClientRect().right;
|
|
120
|
-
})
|
|
121
|
-
.get('.Tooltip')
|
|
122
|
-
.find('.Tooltip-arrow')
|
|
123
|
-
.then($el => {
|
|
124
|
-
tooltipLeft = $el[0].getBoundingClientRect().left;
|
|
125
|
-
|
|
126
|
-
expect(Math.ceil(tooltipLeft - triggerRight)).to.equal(
|
|
127
|
-
16
|
|
128
|
-
);
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
context('Update On Move', () => {
|
|
134
|
-
it('Repositions the tooltip when the window is scrolled or resized', () => {
|
|
135
|
-
let oldStyle = '';
|
|
136
|
-
|
|
137
|
-
cy.visitStory('v1/Tooltip/Position', 'UpdateOnMove')
|
|
138
|
-
// Use force: true on click to prevent Cypress from doing additional scrolling
|
|
139
|
-
// See https://github.com/cypress-io/cypress/issues/553 for more info
|
|
140
|
-
.get('.Tooltip-example')
|
|
141
|
-
.click({force: true})
|
|
142
|
-
.get('.Tooltip')
|
|
143
|
-
.should('exist')
|
|
144
|
-
.then($el => {
|
|
145
|
-
oldStyle = $el[0].getAttribute('style');
|
|
146
|
-
})
|
|
147
|
-
// scroll window and then wait for tooltip to update position
|
|
148
|
-
.window()
|
|
149
|
-
.scrollTo(0, 500)
|
|
150
|
-
.wait(100)
|
|
151
|
-
.get('.Tooltip')
|
|
152
|
-
.then($el => {
|
|
153
|
-
const newStyle = $el[0].getAttribute('style');
|
|
154
|
-
|
|
155
|
-
expect(newStyle !== oldStyle).to.equal(true);
|
|
156
|
-
oldStyle = newStyle;
|
|
157
|
-
})
|
|
158
|
-
// resize window and then wait for tooltip to update position
|
|
159
|
-
.viewport(320, 480)
|
|
160
|
-
.wait(100)
|
|
161
|
-
.get('.Tooltip')
|
|
162
|
-
.then($el => {
|
|
163
|
-
expect(
|
|
164
|
-
$el[0].getAttribute('style') !== oldStyle
|
|
165
|
-
).to.equal(true);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
});
|