File tree Expand file tree Collapse file tree 2 files changed +123
-1
lines changed Expand file tree Collapse file tree 2 files changed +123
-1
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,22 @@ import '../../../src/compas/CompasSave.js';
8
8
9
9
describe ( 'compas-save' , ( ) => {
10
10
let element : CompasSaveElement & CompasExistsInElement ;
11
+ let doc : Document ;
11
12
const docName = 'station123.scd' ;
12
13
const docId = '6a45ae97-5605-44f8-b4e6-25305bc6c036' ;
13
14
15
+ beforeEach ( async ( ) => {
16
+ doc = await fetch ( '/test/testfiles/compas/test-scd.cid' )
17
+ . then ( response => response . text ( ) )
18
+ . then ( str => new DOMParser ( ) . parseFromString ( str , 'application/xml' ) ) ;
19
+ } ) ;
20
+
21
+ // test-scd.cid
14
22
describe ( 'still determining if document exists in CoMPAS' , ( ) => {
15
23
beforeEach ( async ( ) => {
16
24
element = fixtureSync (
17
25
html `< compas-save
26
+ .doc ="${ doc } "
18
27
.docName ="${ docName } "
19
28
.docId ="${ docId } "
20
29
> </ compas-save > `
@@ -35,7 +44,7 @@ describe('compas-save', () => {
35
44
describe ( 'new document in compas' , ( ) => {
36
45
beforeEach ( async ( ) => {
37
46
element = fixtureSync (
38
- html `< compas-save .docName ="${ docName } "> </ compas-save > `
47
+ html `< compas-save .doc =" ${ doc } " . docName ="${ docName } "> </ compas-save > `
39
48
) ;
40
49
41
50
sinon . stub ( element , 'checkExistInCompas' ) . callsFake ( ( ) => {
@@ -55,6 +64,7 @@ describe('compas-save', () => {
55
64
beforeEach ( async ( ) => {
56
65
element = fixtureSync (
57
66
html `< compas-save
67
+ .doc ="${ doc } "
58
68
.docName ="${ docName } "
59
69
.docId ="${ docId } "
60
70
> </ compas-save > `
Original file line number Diff line number Diff line change
1
+ /* @web /test-runner snapshot v1 */
2
+ export const snapshots = { } ;
3
+
4
+ snapshots [ "compas-save still determining if document exists in CoMPAS looks like the latest snapshot" ] =
5
+ `<wizard-divider>
6
+ </wizard-divider>
7
+ <section>
8
+ <h3>
9
+ [compas.save.localTitle]
10
+ </h3>
11
+ <mwc-button label="[compas.save.saveFileButton]">
12
+ </mwc-button>
13
+ </section>
14
+ <wizard-divider>
15
+ </wizard-divider>
16
+ <section>
17
+ <h3>
18
+ [compas.save.compasTitle]
19
+ </h3>
20
+ <compas-loading>
21
+ </compas-loading>
22
+ </section>
23
+ <wizard-divider>
24
+ </wizard-divider>
25
+ <section>
26
+ <h3>
27
+ [compas.save.labelsTitle]
28
+ </h3>
29
+ <compas-labels-field>
30
+ </compas-labels-field>
31
+ </section>
32
+ ` ;
33
+ /* end snapshot compas-save still determining if document exists in CoMPAS looks like the latest snapshot */
34
+
35
+ snapshots [ "compas-save new document in compas looks like the latest snapshot" ] =
36
+ `<wizard-divider>
37
+ </wizard-divider>
38
+ <section>
39
+ <h3>
40
+ [compas.save.localTitle]
41
+ </h3>
42
+ <mwc-button label="[compas.save.saveFileButton]">
43
+ </mwc-button>
44
+ </section>
45
+ <wizard-divider>
46
+ </wizard-divider>
47
+ <section>
48
+ <h3>
49
+ [compas.save.compasTitle]
50
+ </h3>
51
+ <div id="content">
52
+ <mwc-textfield
53
+ dialoginitialfocus=""
54
+ id="name"
55
+ label="[scl.name]"
56
+ required=""
57
+ value="station123"
58
+ >
59
+ </mwc-textfield>
60
+ <compas-scltype-select>
61
+ </compas-scltype-select>
62
+ <compas-comment>
63
+ </compas-comment>
64
+ </div>
65
+ </section>
66
+ <wizard-divider>
67
+ </wizard-divider>
68
+ <section>
69
+ <h3>
70
+ [compas.save.labelsTitle]
71
+ </h3>
72
+ <compas-labels-field>
73
+ </compas-labels-field>
74
+ </section>
75
+ ` ;
76
+ /* end snapshot compas-save new document in compas looks like the latest snapshot */
77
+
78
+ snapshots [ "compas-save existing document in compas looks like the latest snapshot" ] =
79
+ `<wizard-divider>
80
+ </wizard-divider>
81
+ <section>
82
+ <h3>
83
+ [compas.save.localTitle]
84
+ </h3>
85
+ <mwc-button label="[compas.save.saveFileButton]">
86
+ </mwc-button>
87
+ </section>
88
+ <wizard-divider>
89
+ </wizard-divider>
90
+ <section>
91
+ <h3>
92
+ [compas.save.compasTitle]
93
+ </h3>
94
+ <div id="content">
95
+ <compas-changeset-radiogroup>
96
+ </compas-changeset-radiogroup>
97
+ <compas-comment>
98
+ </compas-comment>
99
+ </div>
100
+ </section>
101
+ <wizard-divider>
102
+ </wizard-divider>
103
+ <section>
104
+ <h3>
105
+ [compas.save.labelsTitle]
106
+ </h3>
107
+ <compas-labels-field>
108
+ </compas-labels-field>
109
+ </section>
110
+ ` ;
111
+ /* end snapshot compas-save existing document in compas looks like the latest snapshot */
112
+
You can’t perform that action at this time.
0 commit comments