lightning-base-components 1.18.3-alpha → 1.18.5-alpha
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/metadata/raptor.json +21 -0
- package/package.json +3 -2
- package/src/lightning/baseCombobox/baseCombobox.js +20 -14
- package/src/lightning/buttonIcon/buttonIcon.js +19 -16
- package/src/lightning/combobox/combobox.js +17 -16
- package/src/lightning/primitiveInputCheckbox/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputCheckbox/input-checkbox.slds.css +395 -0
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.css +3 -0
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.html +48 -0
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js +139 -0
- package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +126 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.css +6 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.html +24 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +176 -0
- package/src/lightning/primitiveInputColor/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputColor/input-color.slds.css +35 -0
- package/src/lightning/primitiveInputColor/input-text.slds.css +398 -0
- package/src/lightning/primitiveInputColor/primitiveInputColor.css +4 -0
- package/src/lightning/primitiveInputColor/primitiveInputColor.html +50 -0
- package/src/lightning/primitiveInputColor/primitiveInputColor.js +184 -0
- package/src/lightning/primitiveInputFile/button.slds.css +527 -0
- package/src/lightning/primitiveInputFile/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputFile/input-file.slds.css +62 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.css +5 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.html +45 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.js +111 -0
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.html +24 -0
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.js +103 -0
- package/src/lightning/primitiveInputSimple/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputSimple/input-text.slds.css +398 -0
- package/src/lightning/primitiveInputSimple/normalize.js +6 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.css +9 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.html +65 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +585 -0
- package/src/lightning/primitiveInputSimple/selection.js +131 -0
- package/src/lightning/primitiveInputToggle/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputToggle/input-toggle.slds.css +170 -0
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.css +3 -0
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.html +34 -0
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.js +164 -0
- package/src/lightning/tab/tab.css +2 -0
- package/src/lightning/tab/tab.js +22 -14
- package/src/lightning/tab/tab.slds.css +47 -0
- package/src/lightning/tabset/tabset.css +10 -0
- package/src/lightning/tabset/tabset.js +28 -10
- package/src/lightning/button/__wdio__/utam/utam.html +0 -3
- package/src/lightning/button/__wdio__/utam/utam.js +0 -3
- package/src/lightning/button/__wdio__/utam/utam.spec.js +0 -20
- package/src/lightning/datatable/__wdio__/utam/utam.html +0 -32
- package/src/lightning/datatable/__wdio__/utam/utam.js +0 -91
- package/src/lightning/datatable/__wdio__/utam/utam.spec.js +0 -214
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
const Datatable = require('pageobjects/datatable');
|
|
2
|
-
const Button = require('pageobjects/button');
|
|
3
|
-
|
|
4
|
-
const tableTypes = {
|
|
5
|
-
default: '[data-render-mode="default"]',
|
|
6
|
-
roleBased: '[data-render-mode="role-based"]',
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
describe('Datatable UTAM Page Object Tests', () => {
|
|
10
|
-
Object.keys(tableTypes).forEach((type) => {
|
|
11
|
-
describe(`${type} table`, () => {
|
|
12
|
-
const TABLE_SELECTOR = tableTypes[type];
|
|
13
|
-
|
|
14
|
-
let root;
|
|
15
|
-
|
|
16
|
-
beforeEach(async () => {
|
|
17
|
-
await browser.url('/datatable/utam');
|
|
18
|
-
root = await $('datatable-utam');
|
|
19
|
-
await root.waitForDisplayed();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should get the cell value by row and column index', async () => {
|
|
23
|
-
const datatable = await utam.load(Datatable, {
|
|
24
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const cellValue = await datatable.getCellValueByIndex(1, 2);
|
|
28
|
-
expect(cellValue).toBe('Billy Simmons');
|
|
29
|
-
});
|
|
30
|
-
it('should get the cell value by row index and column label', async () => {
|
|
31
|
-
const datatable = await utam.load(Datatable, {
|
|
32
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const cellValue = await datatable.getCellValueByLabel(2, 'Age');
|
|
36
|
-
expect(cellValue).toBe('35');
|
|
37
|
-
});
|
|
38
|
-
it('should get the number of rows in the table', async () => {
|
|
39
|
-
const datatable = await utam.load(Datatable, {
|
|
40
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const cellValue = await datatable.getNumRows();
|
|
44
|
-
expect(cellValue).toBe(4);
|
|
45
|
-
});
|
|
46
|
-
it('should tell if the table has any rows', async () => {
|
|
47
|
-
const datatable = await utam.load(Datatable, {
|
|
48
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const cellValue = await datatable.hasRows();
|
|
52
|
-
expect(cellValue).toBe(true);
|
|
53
|
-
});
|
|
54
|
-
it('should toggle selection of row - comprehensive', async () => {
|
|
55
|
-
const datatable = await utam.load(Datatable, {
|
|
56
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
for (let i = 1; i <= 4; i++) {
|
|
60
|
-
expect(await datatable.isRowSelected(i)).toBe('false');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
await datatable.toggleRowSelection(1);
|
|
64
|
-
expect(await datatable.isRowSelected(1)).toBe('true');
|
|
65
|
-
[2, 3, 4].forEach(async (i) => {
|
|
66
|
-
expect(await datatable.isRowSelected(i)).toBe('false');
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
await datatable.toggleRowSelection(2);
|
|
70
|
-
expect(await datatable.isRowSelected(2)).toBe('true');
|
|
71
|
-
[3, 4].forEach(async (i) => {
|
|
72
|
-
expect(await datatable.isRowSelected(i)).toBe('false');
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
await datatable.toggleRowSelection(3);
|
|
76
|
-
expect(await datatable.isRowSelected(3)).toBe('true');
|
|
77
|
-
expect(await datatable.isRowSelected(4)).toBe('false');
|
|
78
|
-
|
|
79
|
-
await datatable.toggleRowSelection(4);
|
|
80
|
-
expect(await datatable.isRowSelected(4)).toBe('true');
|
|
81
|
-
});
|
|
82
|
-
it('should toggle selection of row', async () => {
|
|
83
|
-
const datatable = await utam.load(Datatable, {
|
|
84
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
await datatable.toggleRowSelection(3);
|
|
88
|
-
expect(await datatable.isRowSelected(3)).toBe('true');
|
|
89
|
-
|
|
90
|
-
await datatable.toggleRowSelection(3);
|
|
91
|
-
expect(await datatable.isRowSelected(3)).toBe('false');
|
|
92
|
-
});
|
|
93
|
-
it('should get the number of selected rows when not all rows are selected', async () => {
|
|
94
|
-
const datatable = await utam.load(Datatable, {
|
|
95
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
await datatable.toggleRowSelection(3);
|
|
99
|
-
expect(await datatable.getNumSelectedRows()).toBe(1);
|
|
100
|
-
|
|
101
|
-
await datatable.toggleRowSelection(2);
|
|
102
|
-
expect(await datatable.getNumSelectedRows()).toBe(2);
|
|
103
|
-
});
|
|
104
|
-
it('should get the number of selected rows when all rows are selected', async () => {
|
|
105
|
-
const datatable = await utam.load(Datatable, {
|
|
106
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
await datatable.clickSelectAllCheckbox();
|
|
110
|
-
expect(await datatable.getNumSelectedRows()).toBe(4);
|
|
111
|
-
});
|
|
112
|
-
it('should get the number of columns in the table', async () => {
|
|
113
|
-
const datatable = await utam.load(Datatable, {
|
|
114
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
expect(await datatable.getNumColumns()).toBe(5);
|
|
118
|
-
});
|
|
119
|
-
it('should tell whether or not a column is sortable', async () => {
|
|
120
|
-
const datatable = await utam.load(Datatable, {
|
|
121
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
expect(await datatable.isSortableColumn('Age')).toBe(true);
|
|
125
|
-
|
|
126
|
-
// Need to speak to UTAM (about isPresent) or find a better way to write this method
|
|
127
|
-
// If column is not sortable, the test fails with the error:
|
|
128
|
-
// "Can't find elements with locator 'lightning-primitive-header-factory.slds-is-sortable' inside its scope element."
|
|
129
|
-
// expect(await datatable.isSortableColumn('Name')).toBe(false);
|
|
130
|
-
});
|
|
131
|
-
it('should tell whether or not the row is selectable', async () => {
|
|
132
|
-
const datatable = await utam.load(Datatable, {
|
|
133
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
expect(await datatable.isSelectableRow(1)).toBe(true);
|
|
137
|
-
});
|
|
138
|
-
it('should get the width of a column', async () => {
|
|
139
|
-
const datatable = await utam.load(Datatable, {
|
|
140
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
const datatableElement = await root.shadow$(
|
|
144
|
-
'lightning-datatable'
|
|
145
|
-
);
|
|
146
|
-
const columnHeader = await datatableElement.shadow$(
|
|
147
|
-
'[aria-label="Name"]'
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
// Remove intermediate white spaces
|
|
151
|
-
let expectedWidth = await columnHeader.getAttribute('style');
|
|
152
|
-
expectedWidth = expectedWidth.replace(/\s/g, '');
|
|
153
|
-
let actualWidth = await datatable.getWidth('Name');
|
|
154
|
-
actualWidth = actualWidth.replace(/\s/g, '');
|
|
155
|
-
|
|
156
|
-
// Using indexOf in case of presence of ';'
|
|
157
|
-
expect(actualWidth.indexOf(expectedWidth) >= 0).toBe(true);
|
|
158
|
-
});
|
|
159
|
-
it('should tell whether or not a column has header actions', async () => {
|
|
160
|
-
const datatable = await utam.load(Datatable, {
|
|
161
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
expect(await datatable.hasHeaderActions('Name')).toBe(true);
|
|
165
|
-
expect(await datatable.hasHeaderActions('Age')).toBe(true);
|
|
166
|
-
// false fails; need to check for true or null; check with UTAM if expected
|
|
167
|
-
expect(await datatable.hasHeaderActions('Email')).toBe(null);
|
|
168
|
-
});
|
|
169
|
-
it('should get the text of the rowheader cell of the specified row', async () => {
|
|
170
|
-
const datatable = await utam.load(Datatable, {
|
|
171
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
expect(await datatable.getRowHeaderText(2)).toBe(
|
|
175
|
-
'Kelsey Denesik'
|
|
176
|
-
);
|
|
177
|
-
});
|
|
178
|
-
it('should click column header of the sortable column', async () => {
|
|
179
|
-
const datatable = await utam.load(Datatable, {
|
|
180
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
let cellValue = await datatable.getCellValueByLabel(1, 'Age');
|
|
184
|
-
expect(cellValue).toBe('40');
|
|
185
|
-
|
|
186
|
-
await datatable.clickSortHeaderButton('Age');
|
|
187
|
-
|
|
188
|
-
cellValue = await datatable.getCellValueByLabel(1, 'Age');
|
|
189
|
-
expect(cellValue).toBe('35');
|
|
190
|
-
});
|
|
191
|
-
it('should tell whether the specified row has row actions or not', async () => {
|
|
192
|
-
const datatable = await utam.load(Datatable, {
|
|
193
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
expect(await datatable.hasRowActionInRow(2)).toBe(true);
|
|
197
|
-
});
|
|
198
|
-
it('should tell whether or not the datatable has the loading indicator visible', async () => {
|
|
199
|
-
const datatable = await utam.load(Datatable, {
|
|
200
|
-
element: await root.shadow$(TABLE_SELECTOR),
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
expect(await datatable.isLoading()).toBe(false);
|
|
204
|
-
|
|
205
|
-
const button = await utam.load(Button, {
|
|
206
|
-
element: await root.shadow$('lightning-button'),
|
|
207
|
-
});
|
|
208
|
-
await button.click();
|
|
209
|
-
|
|
210
|
-
expect(await datatable.isLoading()).toBe(true);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
});
|