Lines 50-60
function get_processings() {
Link Here
|
50 |
name: "new processing", |
50 |
name: "new processing", |
51 |
processing_id: 1, |
51 |
processing_id: 1, |
52 |
attributes: get_attributes(), |
52 |
attributes: get_attributes(), |
|
|
53 |
letter_code: null, |
53 |
}, |
54 |
}, |
54 |
{ |
55 |
{ |
55 |
name: "an other processing", |
56 |
name: "an other processing", |
56 |
processing_id: 2, |
57 |
processing_id: 2, |
57 |
attributes: get_other_attributes(), |
58 |
attributes: get_other_attributes(), |
|
|
59 |
letter_code: null, |
58 |
}, |
60 |
}, |
59 |
]; |
61 |
]; |
60 |
} |
62 |
} |
Lines 98-125
function get_train_items() {
Link Here
|
98 |
processing_attribute_id: |
100 |
processing_attribute_id: |
99 |
processing_attributes[0].processing_attribute_id, |
101 |
processing_attributes[0].processing_attribute_id, |
100 |
value: "Argentina", |
102 |
value: "Argentina", |
|
|
103 |
_strings: { value: { str: "Argentina" } }, |
101 |
}, |
104 |
}, |
102 |
{ |
105 |
{ |
103 |
processing_attribute: processing_attributes[0], |
106 |
processing_attribute: processing_attributes[0], |
104 |
processing_attribute_id: |
107 |
processing_attribute_id: |
105 |
processing_attributes[0].processing_attribute_id, |
108 |
processing_attributes[0].processing_attribute_id, |
106 |
value: "Not a country", |
109 |
value: "Not a country", |
|
|
110 |
_strings: { value: { str: "Not a country" } }, |
107 |
}, |
111 |
}, |
108 |
{ |
112 |
{ |
109 |
processing_attribute: processing_attributes[1], |
113 |
processing_attribute: processing_attributes[1], |
110 |
processing_attribute_id: |
114 |
processing_attribute_id: |
111 |
processing_attributes[1].processing_attribute_id, |
115 |
processing_attributes[1].processing_attribute_id, |
112 |
value: "a biblio title modified", |
116 |
value: "a biblio title modified", |
|
|
117 |
_strings: { value: { str: "a biblio title modified" } }, |
113 |
}, |
118 |
}, |
114 |
{ |
119 |
{ |
115 |
processing_attribute: processing_attributes[2], |
120 |
processing_attribute: processing_attributes[2], |
116 |
processing_attribute_id: |
121 |
processing_attribute_id: |
117 |
processing_attributes[2].processing_attribute_id, |
122 |
processing_attributes[2].processing_attribute_id, |
118 |
value: "12cm", |
123 |
value: "12cm", |
|
|
124 |
_strings: { value: { str: "12cm" } }, |
119 |
}, |
125 |
}, |
120 |
]; |
126 |
]; |
121 |
train_item_1.added_on = "2023-03-31T12:23:34+00:00"; |
127 |
train_item_1.added_on = "2023-03-31T12:23:34+00:00"; |
122 |
train_item_1.processing_id = 1; |
128 |
train_item_1.processing_id = 1; |
|
|
129 |
train_item_1.processing = get_processings()[0]; |
123 |
train_item_1.item_id = 1; |
130 |
train_item_1.item_id = 1; |
124 |
|
131 |
|
125 |
let train_item_2 = get_items()[1]; |
132 |
let train_item_2 = get_items()[1]; |
Lines 130-151
function get_train_items() {
Link Here
|
130 |
processing_attribute_id: |
137 |
processing_attribute_id: |
131 |
processing_attributes[0].processing_attribute_id, |
138 |
processing_attributes[0].processing_attribute_id, |
132 |
value: "Uruguay", |
139 |
value: "Uruguay", |
|
|
140 |
_strings: { value: { str: "Uruguay" } }, |
133 |
}, |
141 |
}, |
134 |
{ |
142 |
{ |
135 |
processing_attribute: processing_attributes[1], |
143 |
processing_attribute: processing_attributes[1], |
136 |
processing_attribute_id: |
144 |
processing_attribute_id: |
137 |
processing_attributes[1].processing_attribute_id, |
145 |
processing_attributes[1].processing_attribute_id, |
138 |
value: "an other modified title", |
146 |
value: "an other modified title", |
|
|
147 |
_strings: { value: { str: "an other modified title" } }, |
139 |
}, |
148 |
}, |
140 |
{ |
149 |
{ |
141 |
processing_attribute: processing_attributes[2], |
150 |
processing_attribute: processing_attributes[2], |
142 |
processing_attribute_id: |
151 |
processing_attribute_id: |
143 |
processing_attributes[2].processing_attribute_id, |
152 |
processing_attributes[2].processing_attribute_id, |
144 |
value: "34cm", |
153 |
value: "34cm", |
|
|
154 |
_strings: { value: { str: "34cm" } }, |
145 |
}, |
155 |
}, |
146 |
]; |
156 |
]; |
147 |
train_item_2.added_on = "2023-04-01T12:34:56+00:00"; |
157 |
train_item_2.added_on = "2023-04-01T12:34:56+00:00"; |
148 |
train_item_2.processing_id = 1; |
158 |
train_item_2.processing_id = 1; |
|
|
159 |
train_item_2.processing = get_processings()[0]; |
149 |
train_item_2.item_id = 2; |
160 |
train_item_2.item_id = 2; |
150 |
|
161 |
|
151 |
let train_item_3 = get_items()[0]; |
162 |
let train_item_3 = get_items()[0]; |
Lines 156-171
function get_train_items() {
Link Here
|
156 |
processing_attribute_id: |
167 |
processing_attribute_id: |
157 |
processing_attributes[0].processing_attribute_id, |
168 |
processing_attributes[0].processing_attribute_id, |
158 |
value: "Bolivia", |
169 |
value: "Bolivia", |
|
|
170 |
_strings: { value: { str: "Bolivia" } }, |
159 |
}, |
171 |
}, |
160 |
{ |
172 |
{ |
161 |
processing_attribute: processing_attributes[1], |
173 |
processing_attribute: processing_attributes[1], |
162 |
processing_attribute_id: |
174 |
processing_attribute_id: |
163 |
processing_attributes[1].processing_attribute_id, |
175 |
processing_attributes[1].processing_attribute_id, |
164 |
value: "W 123cm", |
176 |
value: "W 123cm", |
|
|
177 |
_strings: { value: { str: "W 123cm" } }, |
165 |
}, |
178 |
}, |
166 |
]; |
179 |
]; |
167 |
train_item_3.added_on = "2023-04-02T12:34:56+00:00"; |
180 |
train_item_3.added_on = "2023-04-02T12:34:56+00:00"; |
168 |
train_item_3.processing_id = 2; |
181 |
train_item_3.processing_id = 2; |
|
|
182 |
train_item_3.processing = get_processings()[1]; |
169 |
train_item_3.item_id = 3; |
183 |
train_item_3.item_id = 3; |
170 |
|
184 |
|
171 |
return [train_item_1, train_item_2, train_item_3]; |
185 |
return [train_item_1, train_item_2, train_item_3]; |
Lines 285-294
describe("Trains", () => {
Link Here
|
285 |
}); |
299 |
}); |
286 |
|
300 |
|
287 |
it("Add train", () => { |
301 |
it("Add train", () => { |
288 |
cy.intercept("GET", "/api/v1/preservation/trains", []); |
302 |
cy.intercept("GET", "/api/v1/preservation/trains*", []); |
289 |
cy.intercept( |
303 |
cy.intercept( |
290 |
"GET", |
304 |
"GET", |
291 |
"/api/v1/preservation/processings", |
305 |
"/api/v1/preservation/processings*", |
292 |
get_processings() |
306 |
get_processings() |
293 |
); |
307 |
); |
294 |
cy.visit("/cgi-bin/koha/preservation/trains"); |
308 |
cy.visit("/cgi-bin/koha/preservation/trains"); |
295 |
- |
|
|