@luomus/laji-form 15.1.1 → 15.1.3
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/dist/laji-form.js +1 -1
- package/dist/styles.css +90 -81
- package/package.json +5 -4
- package/test-export/test-utils.d.ts +194 -121
- package/test-export/test-utils.js +221 -207
- package/tsconfig.test.json +1 -1
- package/test-export/array-spec.d.ts +0 -1
- package/test-export/array-spec.js +0 -204
- package/test-export/bird-point-count-spec.d.ts +0 -1
- package/test-export/bird-point-count-spec.js +0 -62
- package/test-export/collection-contest-form-spec.d.ts +0 -1
- package/test-export/collection-contest-form-spec.js +0 -38
- package/test-export/dataset-form-spec.d.ts +0 -1
- package/test-export/dataset-form-spec.js +0 -50
- package/test-export/date-time-widget-spec.d.ts +0 -1
- package/test-export/date-time-widget-spec.js +0 -188
- package/test-export/geocoder-spec.d.ts +0 -1
- package/test-export/geocoder-spec.js +0 -135
- package/test-export/image-array-spec.d.ts +0 -1
- package/test-export/image-array-spec.js +0 -94
- package/test-export/inject-field-spec.d.ts +0 -1
- package/test-export/inject-field-spec.js +0 -148
- package/test-export/internal-uuids-spec.d.ts +0 -1
- package/test-export/internal-uuids-spec.js +0 -157
- package/test-export/invasive-species-eradication-np-spec.d.ts +0 -1
- package/test-export/invasive-species-eradication-np-spec.js +0 -18
- package/test-export/invasive-species-eradication-spec.d.ts +0 -1
- package/test-export/invasive-species-eradication-spec.js +0 -25
- package/test-export/line-transect-spec.d.ts +0 -1
- package/test-export/line-transect-spec.js +0 -121
- package/test-export/mobile-form-spec.d.ts +0 -1
- package/test-export/mobile-form-spec.js +0 -84
- package/test-export/nafi-spec.d.ts +0 -1
- package/test-export/nafi-spec.js +0 -85
- package/test-export/select-widget-spec.d.ts +0 -1
- package/test-export/select-widget-spec.js +0 -68
- package/test-export/single-item-array-field-spec.d.ts +0 -1
- package/test-export/single-item-array-field-spec.js +0 -92
- package/test-export/syke-butterfly-spec.d.ts +0 -1
- package/test-export/syke-butterfly-spec.js +0 -163
- package/test-export/transaction-form-spec.d.ts +0 -1
- package/test-export/transaction-form-spec.js +0 -63
- package/test-export/trip-report-autosuggest-spec.d.ts +0 -1
- package/test-export/trip-report-autosuggest-spec.js +0 -272
- package/test-export/trip-report-spec.d.ts +0 -1
- package/test-export/trip-report-spec.js +0 -456
- package/test-export/unit-list-shorthand-array-field-spec.d.ts +0 -1
- package/test-export/unit-list-shorthand-array-field-spec.js +0 -71
- package/test-export/validation-spec.d.ts +0 -1
- package/test-export/validation-spec.js +0 -336
- package/test-export/water-bird-spec.d.ts +0 -1
- package/test-export/water-bird-spec.js +0 -30
- package/test-export/wbc-spec.d.ts +0 -1
- package/test-export/wbc-spec.js +0 -82
- package/xsel -b +0 -9
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_utils_1 = require("./test-utils");
|
|
13
|
-
const protractor_1 = require("protractor");
|
|
14
|
-
describe("Line transect (MHL.1)", () => {
|
|
15
|
-
let form;
|
|
16
|
-
let $taxon;
|
|
17
|
-
let unitAutocompleteMock;
|
|
18
|
-
let taxonAutocompleteMock;
|
|
19
|
-
const unitAutocompleteResponse = {
|
|
20
|
-
"key": "llx",
|
|
21
|
-
"value": "llx",
|
|
22
|
-
"payload": {
|
|
23
|
-
"unit": {
|
|
24
|
-
"shortHandText": "llx",
|
|
25
|
-
"identifications": [
|
|
26
|
-
{
|
|
27
|
-
"taxon": "Luscinia luscinia"
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
"informalTaxonGroups": [
|
|
31
|
-
"MVL.1"
|
|
32
|
-
],
|
|
33
|
-
"unitFact": {
|
|
34
|
-
"autocompleteSelectedTaxonID": "MX.32819",
|
|
35
|
-
"lineTransectObsType": "MY.lineTransectObsTypeSong",
|
|
36
|
-
"lineTransectRouteFieldType": "MY.lineTransectRouteFieldTypeOuter"
|
|
37
|
-
},
|
|
38
|
-
"pairCount": 1,
|
|
39
|
-
"individualCount": 1
|
|
40
|
-
},
|
|
41
|
-
"interpretedFrom": {
|
|
42
|
-
"taxon": "LL",
|
|
43
|
-
"type": "X"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const taxonAutocompleteResponse = [
|
|
48
|
-
{
|
|
49
|
-
"key": "MX.32819",
|
|
50
|
-
"value": "Luscinia luscinia",
|
|
51
|
-
"payload": {
|
|
52
|
-
"matchingName": "Luscinia luscinia",
|
|
53
|
-
"informalTaxonGroups": [
|
|
54
|
-
{
|
|
55
|
-
"id": "MVL.1",
|
|
56
|
-
"name": "Linnut"
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"scientificName": "Luscinia luscinia",
|
|
60
|
-
"scientificNameAuthorship": "(Linnaeus, 1758)",
|
|
61
|
-
"taxonRankId": "MX.species",
|
|
62
|
-
"matchType": "exactMatches",
|
|
63
|
-
"cursiveName": true,
|
|
64
|
-
"finnish": true,
|
|
65
|
-
"species": true,
|
|
66
|
-
"nameType": "MX.scientificName",
|
|
67
|
-
"vernacularName": "satakieli"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
];
|
|
71
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
-
form = yield test_utils_1.createForm({ id: "MHL.1", localFormData: true });
|
|
73
|
-
$taxon = form.$locate("gatherings.0.units.0.identifications.0.taxon");
|
|
74
|
-
unitAutocompleteMock = yield form.setMockResponse("/autocomplete/unit", false);
|
|
75
|
-
taxonAutocompleteMock = yield form.setMockResponse("/autocomplete/taxon", false);
|
|
76
|
-
}));
|
|
77
|
-
const $shortHandForIdx = (idx, _idx) => protractor_1.$(`#root_gatherings_${idx}_units_${_idx}_shortHandText`);
|
|
78
|
-
const $shorthand = $shortHandForIdx(0, 0);
|
|
79
|
-
it("shorthand unit is shown", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
expect(yield $shorthand.isDisplayed()).toBe(true);
|
|
81
|
-
}));
|
|
82
|
-
it("shorthand unit expands code after typing code", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
83
|
-
function waitUntilShorthandShowsSchema() {
|
|
84
|
-
return protractor_1.browser.wait(protractor_1.protractor.ExpectedConditions.presenceOf($taxon), 5000, "Code reading timeout");
|
|
85
|
-
}
|
|
86
|
-
yield $shorthand.sendKeys("llx");
|
|
87
|
-
yield $shorthand.sendKeys(protractor_1.protractor.Key.ENTER);
|
|
88
|
-
yield unitAutocompleteMock.resolve(unitAutocompleteResponse);
|
|
89
|
-
yield waitUntilShorthandShowsSchema();
|
|
90
|
-
expect(yield $taxon.isDisplayed()).toBe(true);
|
|
91
|
-
}));
|
|
92
|
-
it("next unit is automatically added", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
-
expect(yield $shortHandForIdx(0, 1).isDisplayed()).toBe(true);
|
|
94
|
-
}));
|
|
95
|
-
it("unit formData matches response", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
96
|
-
const formData = yield form.getChangedData();
|
|
97
|
-
expect(test_utils_1.filterUUIDs(formData.gatherings[0].units[0])).toEqual(unitAutocompleteResponse.payload.unit);
|
|
98
|
-
expect(formData.gatherings[0].units[0].identifications_0_taxon).toBe(undefined);
|
|
99
|
-
expect(formData.gatherings[0].units[0].unitFact_autocompleteSelectedTaxonID).toBe(undefined);
|
|
100
|
-
expect(formData.gatherings[0].units[0].unitFact_lineTransectObsType).toBe(undefined);
|
|
101
|
-
expect(formData.gatherings[0].units[0].unitFact_lineTransectRouteFieldType).toBe(undefined);
|
|
102
|
-
}));
|
|
103
|
-
it("next unit is focused", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
104
|
-
expect(yield test_utils_1.getFocusedId()).toBe(yield $shortHandForIdx(0, 1).getAttribute("id"));
|
|
105
|
-
}));
|
|
106
|
-
it("prev unit is focused after keyboard navigation", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
107
|
-
yield protractor_1.browser.driver.switchTo().activeElement().sendKeys(protractor_1.protractor.Key.chord(protractor_1.protractor.Key.ALT, protractor_1.protractor.Key.UP));
|
|
108
|
-
expect(yield test_utils_1.getFocusedId()).toBe(yield form.$getInputWidget("gatherings.0.units.0.identifications.0.taxon").getAttribute("id"));
|
|
109
|
-
}));
|
|
110
|
-
it("next gathering is focused after keyboard navigation", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
111
|
-
yield protractor_1.browser.driver.switchTo().activeElement().sendKeys(protractor_1.protractor.Key.chord(protractor_1.protractor.Key.ALT, protractor_1.protractor.Key.RIGHT));
|
|
112
|
-
yield protractor_1.browser.sleep(200);
|
|
113
|
-
expect(yield test_utils_1.getFocusedId()).toBe(yield $shortHandForIdx(1, 0).getAttribute("id"));
|
|
114
|
-
}));
|
|
115
|
-
it("when prev focused taxon autocomplete finishes, data isn't in FlatField format", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
116
|
-
yield taxonAutocompleteMock.resolve(taxonAutocompleteResponse);
|
|
117
|
-
const formData = yield form.getChangedData();
|
|
118
|
-
expect(test_utils_1.filterUUIDs(formData.gatherings[0].units[0])).toEqual(unitAutocompleteResponse.payload.unit);
|
|
119
|
-
expect(formData.gatherings[0].units[0].identifications_0_taxon).toBe(undefined);
|
|
120
|
-
}));
|
|
121
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_utils_1 = require("./test-utils");
|
|
13
|
-
const protractor_1 = require("protractor");
|
|
14
|
-
const $blocker = test_utils_1.lajiFormLocate("gatherings.0.geometry").$(".blocker");
|
|
15
|
-
const $imageAddModal = protractor_1.$(".media-add-modal");
|
|
16
|
-
const $mobileEditorMap = protractor_1.$(".laji-form.fullscreen .laji-form-map");
|
|
17
|
-
describe("Mobile form (MHL.51)", () => {
|
|
18
|
-
describe("without formData", () => {
|
|
19
|
-
let form;
|
|
20
|
-
it("navigate to form", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
form = yield test_utils_1.createForm({ id: "MHL.51" });
|
|
22
|
-
}));
|
|
23
|
-
it("is displayed", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
expect(yield form.$form.isPresent()).toBe(true);
|
|
25
|
-
}));
|
|
26
|
-
it("image add modal is displayed", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
expect(yield $imageAddModal.isPresent()).toBe(true);
|
|
28
|
-
}));
|
|
29
|
-
it("clicking cancel on image add modal hides it", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
-
yield $imageAddModal.$(".cancel").click();
|
|
31
|
-
expect(yield $imageAddModal.isPresent()).toBe(false);
|
|
32
|
-
}));
|
|
33
|
-
});
|
|
34
|
-
describe("with formData with geometry", () => {
|
|
35
|
-
let form;
|
|
36
|
-
it("navigate to form", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
form = yield test_utils_1.createForm({ id: "MHL.51", localFormData: "MHL.51-geometry" });
|
|
38
|
-
}));
|
|
39
|
-
it("is displayed", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
-
expect(yield form.$form.isPresent()).toBe(true);
|
|
41
|
-
}));
|
|
42
|
-
it("image add modal is displayed", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
-
expect(yield $imageAddModal.isPresent()).toBe(true);
|
|
44
|
-
}));
|
|
45
|
-
it("map doesn't geolocating blocker since it has geometry", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
-
expect(yield $blocker.isPresent()).toBe(false);
|
|
47
|
-
}));
|
|
48
|
-
it("map doesn't show mobile editor", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
-
yield protractor_1.browser.sleep(100);
|
|
50
|
-
expect(yield $mobileEditorMap.isPresent()).toBe(false);
|
|
51
|
-
}));
|
|
52
|
-
});
|
|
53
|
-
describe("with formData with image", () => {
|
|
54
|
-
let form;
|
|
55
|
-
it("navigate to form", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
-
form = yield test_utils_1.createForm({ id: "MHL.51", localFormData: "MHL.51-image-geometry" });
|
|
57
|
-
}));
|
|
58
|
-
it("is displayed", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
expect(yield form.$form.isPresent()).toBe(true);
|
|
60
|
-
}));
|
|
61
|
-
it("image add modal isn't displayed", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
expect(yield $imageAddModal.isPresent()).toBe(false);
|
|
63
|
-
}));
|
|
64
|
-
it("map doesn't geolocating blocker since it has geometry", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
-
expect(yield $blocker.isPresent()).toBe(false);
|
|
66
|
-
}));
|
|
67
|
-
it("map doesn't show mobile editor", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
-
yield protractor_1.browser.sleep(100);
|
|
69
|
-
expect(yield $mobileEditorMap.isPresent()).toBe(false);
|
|
70
|
-
}));
|
|
71
|
-
});
|
|
72
|
-
describe("with formData without image and edit mode", () => {
|
|
73
|
-
let form;
|
|
74
|
-
it("navigate to form", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
-
form = yield test_utils_1.createForm({ id: "MHL.51", localFormData: "MHL.51-geometry", isEdit: true });
|
|
76
|
-
}));
|
|
77
|
-
it("is displayed", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
-
expect(yield form.$form.isPresent()).toBe(true);
|
|
79
|
-
}));
|
|
80
|
-
it("image add modal isn't displayed", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
expect(yield $imageAddModal.isPresent()).toBe(false);
|
|
82
|
-
}));
|
|
83
|
-
});
|
|
84
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/test-export/nafi-spec.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_utils_1 = require("./test-utils");
|
|
13
|
-
const protractor_1 = require("protractor");
|
|
14
|
-
const taxonAutocompleteResponse = [{
|
|
15
|
-
"key": "MX.46587",
|
|
16
|
-
"value": "kettu",
|
|
17
|
-
"payload": {
|
|
18
|
-
"matchingName": "kettu",
|
|
19
|
-
"informalTaxonGroups": [
|
|
20
|
-
{
|
|
21
|
-
"id": "MVL.2",
|
|
22
|
-
"name": "Nisäkkäät"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"scientificName": "Vulpes vulpes",
|
|
26
|
-
"scientificNameAuthorship": "(Linnaeus, 1758)",
|
|
27
|
-
"taxonRankId": "MX.species",
|
|
28
|
-
"matchType": "exactMatches",
|
|
29
|
-
"cursiveName": true,
|
|
30
|
-
"finnish": true,
|
|
31
|
-
"species": true,
|
|
32
|
-
"nameType": "MX.vernacularName",
|
|
33
|
-
"vernacularName": "kettu"
|
|
34
|
-
}
|
|
35
|
-
}];
|
|
36
|
-
describe("NAFI (MHL.6)", () => {
|
|
37
|
-
let form;
|
|
38
|
-
let taxonAutosuggest;
|
|
39
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
-
form = yield test_utils_1.createForm({ id: "MHL.6" });
|
|
41
|
-
}));
|
|
42
|
-
it("can add unit", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
-
yield form.$locateButton("gatherings.0.units", "add").click();
|
|
44
|
-
expect(yield form.$locate("gatherings.0.units.121").isDisplayed()).toBe(true);
|
|
45
|
-
}));
|
|
46
|
-
describe("selecting species name with mouse", () => {
|
|
47
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
taxonAutosuggest = form.getTaxonAutosuggestWidget("gatherings.0.units.121.identifications.0.taxon");
|
|
49
|
-
}));
|
|
50
|
-
it("selects suggestion value", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
const autocompleteMock = yield form.setMockResponse("/autocomplete/taxon", false);
|
|
52
|
-
yield taxonAutosuggest.$input.sendKeys("kettu");
|
|
53
|
-
yield autocompleteMock.resolve(taxonAutocompleteResponse);
|
|
54
|
-
yield taxonAutosuggest.waitForSuggestionsToLoad();
|
|
55
|
-
yield taxonAutosuggest.$$suggestions.first().click();
|
|
56
|
-
expect(yield taxonAutosuggest.$input.getAttribute("value")).toBe("kettu");
|
|
57
|
-
yield autocompleteMock.remove();
|
|
58
|
-
}));
|
|
59
|
-
it("and is marked as suggested", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
-
expect(yield taxonAutosuggest.isSuggested()).toBe(true);
|
|
61
|
-
}));
|
|
62
|
-
it("and closes suggestion list", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
expect(yield taxonAutosuggest.$suggestionsContainer.isPresent()).toBe(false);
|
|
64
|
-
}));
|
|
65
|
-
});
|
|
66
|
-
describe("selecting species name with keyboard navigation", () => {
|
|
67
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
-
taxonAutosuggest = form.getTaxonAutosuggestWidget("gatherings.0.units.122.identifications.0.taxon");
|
|
69
|
-
}));
|
|
70
|
-
it("works", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
-
yield form.$locateButton("gatherings.0.units", "add").click();
|
|
72
|
-
yield taxonAutosuggest.$input.sendKeys("kettu");
|
|
73
|
-
yield taxonAutosuggest.waitForSuggestionsToLoad();
|
|
74
|
-
yield taxonAutosuggest.$input.sendKeys(protractor_1.protractor.Key.DOWN);
|
|
75
|
-
yield taxonAutosuggest.$input.sendKeys(protractor_1.protractor.Key.ENTER);
|
|
76
|
-
expect(yield taxonAutosuggest.$input.getAttribute("value")).toBe("kettu");
|
|
77
|
-
}));
|
|
78
|
-
it("and is marked as suggested", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
79
|
-
expect(yield taxonAutosuggest.isSuggested()).toBe(true);
|
|
80
|
-
}));
|
|
81
|
-
it("and closes suggestion list", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
-
expect(yield taxonAutosuggest.$suggestionsContainer.isPresent()).toBe(false);
|
|
83
|
-
}));
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_utils_1 = require("./test-utils");
|
|
13
|
-
const protractor_1 = require("protractor");
|
|
14
|
-
describe("SelectWidget", () => {
|
|
15
|
-
let form;
|
|
16
|
-
const enums = {
|
|
17
|
-
"": "",
|
|
18
|
-
a: "aLabel",
|
|
19
|
-
b: "bLabel",
|
|
20
|
-
c: "cLabel",
|
|
21
|
-
};
|
|
22
|
-
const schema = {
|
|
23
|
-
type: "string",
|
|
24
|
-
enum: Object.keys(enums),
|
|
25
|
-
enumNames: Object.keys(enums).map(e => enums[e])
|
|
26
|
-
};
|
|
27
|
-
const initialFormData = "b";
|
|
28
|
-
let enumWidget;
|
|
29
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
-
form = yield test_utils_1.createForm({ schema, formData: initialFormData });
|
|
31
|
-
enumWidget = form.$getEnumWidget("");
|
|
32
|
-
}));
|
|
33
|
-
it("renders initial value", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
-
expect(yield enumWidget.$input.getAttribute("value")).toBe(enums[initialFormData]);
|
|
35
|
-
}));
|
|
36
|
-
it("empty value is selectable", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
yield enumWidget.openEnums();
|
|
38
|
-
yield enumWidget.$$enums.first().click();
|
|
39
|
-
expect(yield form.getChangedData()).toBe(null);
|
|
40
|
-
}));
|
|
41
|
-
it("nonempty value is selectable after empty was selected", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
-
yield enumWidget.openEnums();
|
|
43
|
-
yield enumWidget.$$enums.last().click();
|
|
44
|
-
expect(yield enumWidget.$input.getAttribute("value")).toBe(enums.c);
|
|
45
|
-
expect(yield form.getChangedData()).toBe("c");
|
|
46
|
-
}));
|
|
47
|
-
it("selecting value and then empty value without blurring in between keeps empty value", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
yield enumWidget.openEnums();
|
|
49
|
-
yield enumWidget.$$enums.last().click();
|
|
50
|
-
yield enumWidget.openEnums();
|
|
51
|
-
yield enumWidget.$$enums.first().click();
|
|
52
|
-
expect(yield form.getChangedData()).toBe(null);
|
|
53
|
-
}));
|
|
54
|
-
it("value can be selected with enter", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
-
yield enumWidget.openEnums();
|
|
56
|
-
yield enumWidget.$input.sendKeys(protractor_1.protractor.Key.DOWN);
|
|
57
|
-
yield enumWidget.$input.sendKeys(protractor_1.protractor.Key.ENTER);
|
|
58
|
-
expect(yield enumWidget.$input.getAttribute("value")).toBe(enums.a);
|
|
59
|
-
expect(yield form.getChangedData()).toBe("a");
|
|
60
|
-
}));
|
|
61
|
-
it("value can be selected with tab", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
yield enumWidget.openEnums();
|
|
63
|
-
yield enumWidget.$input.sendKeys(protractor_1.protractor.Key.DOWN);
|
|
64
|
-
yield enumWidget.$input.sendKeys(protractor_1.protractor.Key.TAB);
|
|
65
|
-
expect(yield enumWidget.$input.getAttribute("value")).toBe(enums.b);
|
|
66
|
-
expect(yield form.getChangedData()).toBe("b");
|
|
67
|
-
}));
|
|
68
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_utils_1 = require("./test-utils");
|
|
13
|
-
const protractor_1 = require("protractor");
|
|
14
|
-
describe("SingleItemArrayField", () => {
|
|
15
|
-
const uiSchema = {
|
|
16
|
-
"ui:field": "SingleItemArrayField",
|
|
17
|
-
};
|
|
18
|
-
let form;
|
|
19
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
form = yield test_utils_1.createForm();
|
|
21
|
-
}));
|
|
22
|
-
describe("object", () => {
|
|
23
|
-
const schema = {
|
|
24
|
-
type: "array",
|
|
25
|
-
items: {
|
|
26
|
-
type: "object",
|
|
27
|
-
properties: {
|
|
28
|
-
a: { type: "string" }
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const formData = [{ a: "foo" }, { a: "bar" }];
|
|
33
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
-
yield form.setState({ schema, uiSchema, formData });
|
|
35
|
-
}));
|
|
36
|
-
it("uses first item by default and keeps idSchema intact", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
expect(yield form.$getInputWidget("0.a").isDisplayed()).toBe(true);
|
|
38
|
-
}));
|
|
39
|
-
describe("respects activeIdx and", () => {
|
|
40
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
-
yield form.setState({ uiSchema: Object.assign(Object.assign({}, uiSchema), { "ui:options": { activeIdx: 1 } }) });
|
|
42
|
-
}));
|
|
43
|
-
it("renders only single item", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
expect(yield form.$locate("1.a").isDisplayed()).toBe(true);
|
|
45
|
-
expect(yield form.$locate("0.a").isPresent()).toBe(false);
|
|
46
|
-
}));
|
|
47
|
-
it("renders form data", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
expect(yield form.$getInputWidget("1.a").getAttribute("value")).toBe(formData[1].a);
|
|
49
|
-
}));
|
|
50
|
-
it("onChange", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
yield test_utils_1.updateValue(form.$getInputWidget("1.a"), "test");
|
|
52
|
-
expect(yield form.$getInputWidget("1.a").getAttribute("value")).toBe("test");
|
|
53
|
-
}));
|
|
54
|
-
it("renders item errors", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
-
yield form.setState({
|
|
56
|
-
formData: [{ a: "a" }, { a: 1 }]
|
|
57
|
-
});
|
|
58
|
-
yield form.submit();
|
|
59
|
-
expect(yield form.$$getFieldErrors("1.a").count()).toBe(1);
|
|
60
|
-
}));
|
|
61
|
-
it("renders array errors", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
yield form.setState({
|
|
63
|
-
schema: Object.assign(Object.assign({}, schema), { minItems: 1 }),
|
|
64
|
-
formData: []
|
|
65
|
-
});
|
|
66
|
-
yield form.submit();
|
|
67
|
-
expect(yield form.$$getFieldErrors("").count()).toBe(1);
|
|
68
|
-
}));
|
|
69
|
-
});
|
|
70
|
-
it("formats title", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
-
yield form.setState({ uiSchema: Object.assign(Object.assign({}, uiSchema), { "ui:title": "test %{idx} test" }) });
|
|
72
|
-
expect(yield protractor_1.element(protractor_1.by.cssContainingText("span", "test 1 test")).isDisplayed()).toBe(true);
|
|
73
|
-
}));
|
|
74
|
-
it("respects titleClassName option", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
-
yield form.setState({ uiSchema: Object.assign(Object.assign({}, uiSchema), { "ui:title": "test", "ui:options": { titleClassName: "title-format-test" } }) });
|
|
76
|
-
expect(yield protractor_1.$(".title-format-test").isDisplayed()).toBe(true);
|
|
77
|
-
}));
|
|
78
|
-
});
|
|
79
|
-
describe("string array with unique items", () => {
|
|
80
|
-
const schema = { type: "array", uniqueItems: true, title: "test", items: { type: "string", enum: ["a"], enumNames: ["a"] } };
|
|
81
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
-
yield form.setState({ schema, uiSchema });
|
|
83
|
-
}));
|
|
84
|
-
it("is rendered as select", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
-
expect(yield form.$getEnumWidget("").$container.isDisplayed()).toBe(true);
|
|
86
|
-
}));
|
|
87
|
-
it("renders title as label", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
-
expect(yield protractor_1.$("label").isDisplayed()).toBe(true);
|
|
89
|
-
expect(yield protractor_1.$("legend").isPresent()).toBe(false);
|
|
90
|
-
}));
|
|
91
|
-
});
|
|
92
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_utils_1 = require("./test-utils");
|
|
13
|
-
const protractor_1 = require("protractor");
|
|
14
|
-
describe("SYKE butterfly form (MHL.59)", () => {
|
|
15
|
-
let form;
|
|
16
|
-
let $firstUnitsAdd;
|
|
17
|
-
let $secondUnitsAdd;
|
|
18
|
-
let $gatheringsAdd;
|
|
19
|
-
it("navigate to form", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const formData = {
|
|
21
|
-
"gatherings": [
|
|
22
|
-
{
|
|
23
|
-
"section": 1,
|
|
24
|
-
"units": []
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"units": []
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
};
|
|
31
|
-
form = yield test_utils_1.createForm({ id: "MHL.59", formData });
|
|
32
|
-
const $$addButtons = yield form.$locate("gatherings.0.units").$$("button");
|
|
33
|
-
$firstUnitsAdd = $$addButtons[0];
|
|
34
|
-
$secondUnitsAdd = $$addButtons[1];
|
|
35
|
-
$gatheringsAdd = form.$locateButton("gatherings", "add");
|
|
36
|
-
//$lastGatheringsUnitsAdd = form.$locateButton("gatherings.1.units", "add");
|
|
37
|
-
}));
|
|
38
|
-
it("has gatherings", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
expect(yield form.$locate("gatherings").isDisplayed()).toBe(true);
|
|
40
|
-
}));
|
|
41
|
-
it("has one gathering by default", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
-
expect(yield form.$locate("gatherings.0").isDisplayed()).toBe(true);
|
|
43
|
-
}));
|
|
44
|
-
it("has gatherings add", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
-
expect(yield $gatheringsAdd.isDisplayed()).toBe(true);
|
|
46
|
-
}));
|
|
47
|
-
it("has first unit add", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
expect(yield $firstUnitsAdd.isDisplayed()).toBe(true);
|
|
49
|
-
}));
|
|
50
|
-
it("has second unit add", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
expect(yield $secondUnitsAdd.isDisplayed()).toBe(true);
|
|
52
|
-
}));
|
|
53
|
-
describe("adding unit to first group", () => {
|
|
54
|
-
it("works", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
-
yield $firstUnitsAdd.click();
|
|
56
|
-
expect(yield form.$locate("gatherings.0.units.0.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
57
|
-
expect(yield form.$locate("gatherings.0.units.0.individualCount").isDisplayed()).toBe(true);
|
|
58
|
-
}));
|
|
59
|
-
it("autofocuses", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
-
expect(yield test_utils_1.getFocusedId()).toBe(yield form.$getInputWidget("gatherings.0.units.0.identifications.0.taxonVerbatim").getAttribute("id"));
|
|
61
|
-
}));
|
|
62
|
-
});
|
|
63
|
-
describe("adding unit to second group", () => {
|
|
64
|
-
it("works", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
-
yield $secondUnitsAdd.click();
|
|
66
|
-
expect(yield form.$locate("gatherings.0.units.0.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
67
|
-
expect(yield form.$locate("gatherings.0.units.1.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
68
|
-
expect(yield form.$locate("gatherings.0.units.0.individualCount").isDisplayed()).toBe(true);
|
|
69
|
-
expect(yield form.$locate("gatherings.0.units.1.individualCount").isDisplayed()).toBe(true);
|
|
70
|
-
}));
|
|
71
|
-
it("autofocuses", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
-
expect(yield test_utils_1.getFocusedId()).toBe(yield form.$getInputWidget("gatherings.0.units.1.identifications.0.taxonVerbatim").getAttribute("id"));
|
|
73
|
-
}));
|
|
74
|
-
});
|
|
75
|
-
describe("adding new section", () => {
|
|
76
|
-
it("works", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
77
|
-
yield $gatheringsAdd.click();
|
|
78
|
-
yield form.$locateAddition("gatherings", "section-input").sendKeys("2");
|
|
79
|
-
yield form.$locateAddition("gatherings", "section-input").sendKeys(protractor_1.protractor.Key.ENTER);
|
|
80
|
-
expect(yield form.$locate("gatherings.0.units.1.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
81
|
-
expect(yield form.$locate("gatherings.0.units.0.individualCount").isDisplayed()).toBe(true);
|
|
82
|
-
expect(yield form.$locate("gatherings.0.units.1.individualCount").isDisplayed()).toBe(true);
|
|
83
|
-
expect(yield form.$locate("gatherings.1.units.0.individualCount").isDisplayed()).toBe(true);
|
|
84
|
-
expect(yield form.$locate("gatherings.1.units.1.individualCount").isDisplayed()).toBe(true);
|
|
85
|
-
}));
|
|
86
|
-
// Works really but test suite fails
|
|
87
|
-
//it("autofocuses", async () => {
|
|
88
|
-
// expect(await getFocusedId() === await form.$getInputWidget("gatherings.1.gatheringFact.sykeButterFlyCensusWind").getAttribute("id")).toBe(true);
|
|
89
|
-
//});
|
|
90
|
-
});
|
|
91
|
-
describe("adding unit to first group again", () => {
|
|
92
|
-
it("works", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
-
yield $firstUnitsAdd.click();
|
|
94
|
-
expect(yield form.$locate("gatherings.0.units.0.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
95
|
-
expect(yield form.$locate("gatherings.0.units.1.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
96
|
-
expect(yield form.$locate("gatherings.0.units.2.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
97
|
-
expect(yield form.$locate("gatherings.0.units.0.individualCount").isDisplayed()).toBe(true);
|
|
98
|
-
expect(yield form.$locate("gatherings.0.units.1.individualCount").isDisplayed()).toBe(true);
|
|
99
|
-
expect(yield form.$locate("gatherings.0.units.2.individualCount").isDisplayed()).toBe(true);
|
|
100
|
-
expect(yield form.$locate("gatherings.1.units.0.individualCount").isDisplayed()).toBe(true);
|
|
101
|
-
expect(yield form.$locate("gatherings.1.units.1.individualCount").isDisplayed()).toBe(true);
|
|
102
|
-
expect(yield form.$locate("gatherings.1.units.2.individualCount").isDisplayed()).toBe(true);
|
|
103
|
-
}));
|
|
104
|
-
it("autofocuses", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
105
|
-
expect(yield test_utils_1.getFocusedId()).toBe(yield form.$getInputWidget("gatherings.0.units.1.identifications.0.taxonVerbatim").getAttribute("id"));
|
|
106
|
-
}));
|
|
107
|
-
});
|
|
108
|
-
describe("adding unit to second group again", () => {
|
|
109
|
-
it("works", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
110
|
-
yield $secondUnitsAdd.click();
|
|
111
|
-
expect(yield form.$locate("gatherings.0.units.0.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
112
|
-
expect(yield form.$locate("gatherings.0.units.1.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
113
|
-
expect(yield form.$locate("gatherings.0.units.2.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
114
|
-
expect(yield form.$locate("gatherings.0.units.3.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
115
|
-
expect(yield form.$locate("gatherings.0.units.0.individualCount").isDisplayed()).toBe(true);
|
|
116
|
-
expect(yield form.$locate("gatherings.0.units.1.individualCount").isDisplayed()).toBe(true);
|
|
117
|
-
expect(yield form.$locate("gatherings.0.units.2.individualCount").isDisplayed()).toBe(true);
|
|
118
|
-
expect(yield form.$locate("gatherings.0.units.3.individualCount").isDisplayed()).toBe(true);
|
|
119
|
-
expect(yield form.$locate("gatherings.1.units.0.individualCount").isDisplayed()).toBe(true);
|
|
120
|
-
expect(yield form.$locate("gatherings.1.units.1.individualCount").isDisplayed()).toBe(true);
|
|
121
|
-
expect(yield form.$locate("gatherings.1.units.2.individualCount").isDisplayed()).toBe(true);
|
|
122
|
-
expect(yield form.$locate("gatherings.1.units.3.individualCount").isDisplayed()).toBe(true);
|
|
123
|
-
}));
|
|
124
|
-
it("autofocuses", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
125
|
-
expect(yield test_utils_1.getFocusedId()).toBe(yield form.$getInputWidget("gatherings.0.units.3.identifications.0.taxonVerbatim").getAttribute("id"));
|
|
126
|
-
}));
|
|
127
|
-
});
|
|
128
|
-
describe("adding new section again", () => {
|
|
129
|
-
it("works", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
-
yield $gatheringsAdd.click();
|
|
131
|
-
yield form.$locateAddition("gatherings", "section-input").sendKeys("3");
|
|
132
|
-
yield form.$locateAddition("gatherings", "section-input").sendKeys(protractor_1.protractor.Key.ENTER);
|
|
133
|
-
expect(yield form.$locate("gatherings.0.units.0.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
134
|
-
expect(yield form.$locate("gatherings.0.units.1.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
135
|
-
expect(yield form.$locate("gatherings.0.units.2.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
136
|
-
expect(yield form.$locate("gatherings.0.units.3.identifications.0.taxonVerbatim").isDisplayed()).toBe(true);
|
|
137
|
-
expect(yield form.$locate("gatherings.0.units.0.individualCount").isDisplayed()).toBe(true);
|
|
138
|
-
expect(yield form.$locate("gatherings.0.units.1.individualCount").isDisplayed()).toBe(true);
|
|
139
|
-
expect(yield form.$locate("gatherings.0.units.2.individualCount").isDisplayed()).toBe(true);
|
|
140
|
-
expect(yield form.$locate("gatherings.0.units.3.individualCount").isDisplayed()).toBe(true);
|
|
141
|
-
expect(yield form.$locate("gatherings.1.units.0.individualCount").isDisplayed()).toBe(true);
|
|
142
|
-
expect(yield form.$locate("gatherings.1.units.1.individualCount").isDisplayed()).toBe(true);
|
|
143
|
-
expect(yield form.$locate("gatherings.1.units.2.individualCount").isDisplayed()).toBe(true);
|
|
144
|
-
expect(yield form.$locate("gatherings.1.units.3.individualCount").isDisplayed()).toBe(true);
|
|
145
|
-
expect(yield form.$locate("gatherings.2.units.0.individualCount").isDisplayed()).toBe(true);
|
|
146
|
-
expect(yield form.$locate("gatherings.2.units.1.individualCount").isDisplayed()).toBe(true);
|
|
147
|
-
expect(yield form.$locate("gatherings.2.units.2.individualCount").isDisplayed()).toBe(true);
|
|
148
|
-
expect(yield form.$locate("gatherings.2.units.3.individualCount").isDisplayed()).toBe(true);
|
|
149
|
-
}));
|
|
150
|
-
// Works really but test suite fails
|
|
151
|
-
//it("autofocuses", async () => {
|
|
152
|
-
// expect(await getFocusedId() === await form.$getInputWidget("gatherings.2.gatheringFact.sykeButterFlyCensusWind").getAttribute("id")).toBe(true);
|
|
153
|
-
//});
|
|
154
|
-
});
|
|
155
|
-
it("removing new section works", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
156
|
-
const gatheringsLength = (yield form.getChangedData()).gatherings.length;
|
|
157
|
-
yield form.$locateButton("gatherings.0", "delete").click();
|
|
158
|
-
const formData = yield form.getChangedData();
|
|
159
|
-
expect(formData.gatherings.length).not.toBe(gatheringsLength);
|
|
160
|
-
expect(formData.gatherings[0].section).toBe(2);
|
|
161
|
-
expect(formData.gatherings[formData.gatherings.length - 1].section).toBe(undefined);
|
|
162
|
-
}));
|
|
163
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|