Skip to content

Commit f0bcbb8

Browse files
fix: fix lint issues
1 parent d88c29c commit f0bcbb8

File tree

1 file changed

+73
-63
lines changed

1 file changed

+73
-63
lines changed

test/sanity-check/api/stack-test.js

Lines changed: 73 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -95,105 +95,115 @@ describe('Stack api Test', () => {
9595
const variables = {
9696
stack_variables: {
9797
enforce_unique_urls: true,
98-
sys_rte_allowed_tags: "style,figure,script",
99-
sys_rte_skip_format_on_paste: "GD:font-size",
100-
samplevariable: "too"
98+
sys_rte_allowed_tags: 'style,figure,script',
99+
sys_rte_skip_format_on_paste: 'GD:font-size',
100+
samplevariable: 'too'
101101
}
102-
};
102+
}
103103

104104
client.stack({ api_key: stacks.api_key })
105105
.addSettings(variables)
106106
.then((response) => {
107-
const vars = response.stack_variables;
108-
expect(vars.enforce_unique_urls).to.equal(true);
109-
expect(vars.sys_rte_allowed_tags).to.equal("style,figure,script");
110-
expect(vars.sys_rte_skip_format_on_paste).to.equal("GD:font-size");
111-
expect(vars.samplevariable).to.equal("too");
112-
done();
107+
const vars = response.stack_variables
108+
expect(vars.enforce_unique_urls).to.equal(true)
109+
expect(vars.sys_rte_allowed_tags).to.equal('style,figure,script')
110+
expect(vars.sys_rte_skip_format_on_paste).to.equal('GD:font-size')
111+
expect(vars.samplevariable).to.equal('too')
112+
done()
113113
})
114-
.catch(done);
115-
});
114+
.catch(done)
115+
})
116116

117117
it('should set rte settings correctly', done => {
118118
const variables = {
119119
rte: {
120120
cs_breakline_on_enter: true,
121121
cs_only_breakline: true
122122
}
123-
};
123+
}
124124

125125
client.stack({ api_key: stacks.api_key })
126126
.addSettings(variables)
127127
.then((response) => {
128-
const rte = response.rte;
129-
expect(rte.cs_breakline_on_enter).to.equal(true);
130-
expect(rte.cs_only_breakline).to.equal(true);
131-
done();
128+
const rte = response.rte
129+
expect(rte.cs_breakline_on_enter).to.equal(true)
130+
expect(rte.cs_only_breakline).to.equal(true)
131+
done()
132132
})
133-
.catch(done);
134-
});
133+
.catch(done)
134+
})
135135

136136
it('should set live_preview settings correctly', done => {
137137
const variables = {
138138
live_preview: {
139139
enabled: true,
140-
"default-env": "",
141-
"default-url": "https://preview.example.com"
140+
'default-env': '',
141+
'default-url': 'https://preview.example.com'
142142
}
143-
};
143+
}
144144

145145
client.stack({ api_key: stacks.api_key })
146146
.addSettings(variables)
147147
.then((response) => {
148-
const preview = response.live_preview;
149-
expect(preview.enabled).to.equal(true);
150-
expect(preview["default-env"]).to.equal("");
151-
expect(preview["default-url"]).to.equal("https://preview.example.com");
152-
done();
148+
const preview = response.live_preview
149+
expect(preview.enabled).to.equal(true)
150+
expect(preview['default-env']).to.equal('')
151+
expect(preview['default-url']).to.equal('https://preview.example.com')
152+
done()
153153
})
154-
.catch(done);
155-
});
154+
.catch(done)
155+
})
156+
157+
it('should add simple stack variable', done => {
158+
client.stack({ api_key: stacks.api_key })
159+
.addSettings({ samplevariable: 'too' })
160+
.then((response) => {
161+
expect(response.stack_variables.samplevariable).to.be.equal('too', 'samplevariable must set to \'too\' ')
162+
done()
163+
})
164+
.catch(done)
165+
})
156166

157167
it('should add stack settings', done => {
158-
const variables = {
159-
stack_variables: {
160-
enforce_unique_urls: true,
161-
sys_rte_allowed_tags: "style,figure,script",
162-
sys_rte_skip_format_on_paste: "GD:font-size",
163-
samplevariable: "too"
164-
},
165-
rte: {
166-
cs_breakline_on_enter: true,
167-
cs_only_breakline: true
168-
},
169-
live_preview: {
170-
enabled: true,
171-
"default-env": "",
172-
"default-url": "https://preview.example.com"
168+
const variables = {
169+
stack_variables: {
170+
enforce_unique_urls: true,
171+
sys_rte_allowed_tags: 'style,figure,script',
172+
sys_rte_skip_format_on_paste: 'GD:font-size',
173+
samplevariable: 'too'
174+
},
175+
rte: {
176+
cs_breakline_on_enter: true,
177+
cs_only_breakline: true
178+
},
179+
live_preview: {
180+
enabled: true,
181+
'default-env': '',
182+
'default-url': 'https://preview.example.com'
183+
}
173184
}
174-
};
175185

176-
client.stack({ api_key: stacks.api_key })
177-
.addSettings(variables) .then((response) => {
178-
const vars = response.stack_variables;
179-
expect(vars.enforce_unique_urls).to.equal(true, 'enforce_unique_urls must be true');
180-
expect(vars.sys_rte_allowed_tags).to.equal("style,figure,script", 'sys_rte_allowed_tags must match');
181-
expect(vars.sys_rte_skip_format_on_paste).to.equal("GD:font-size", 'sys_rte_skip_format_on_paste must match');
182-
expect(vars.samplevariable).to.equal("too", 'samplevariable must be "too"');
186+
client.stack({ api_key: stacks.api_key })
187+
.addSettings(variables).then((response) => {
188+
const vars = response.stack_variables
189+
expect(vars.enforce_unique_urls).to.equal(true, 'enforce_unique_urls must be true')
190+
expect(vars.sys_rte_allowed_tags).to.equal('style,figure,script', 'sys_rte_allowed_tags must match')
191+
expect(vars.sys_rte_skip_format_on_paste).to.equal('GD:font-size', 'sys_rte_skip_format_on_paste must match')
192+
expect(vars.samplevariable).to.equal('too', 'samplevariable must be "too"')
183193

184-
const rte = response.rte;
185-
expect(rte.cs_breakline_on_enter).to.equal(true, 'cs_breakline_on_enter must be true');
186-
expect(rte.cs_only_breakline).to.equal(true, 'cs_only_breakline must be true');
194+
const rte = response.rte
195+
expect(rte.cs_breakline_on_enter).to.equal(true, 'cs_breakline_on_enter must be true')
196+
expect(rte.cs_only_breakline).to.equal(true, 'cs_only_breakline must be true')
187197

188-
const preview = response.live_preview;
189-
expect(preview.enabled).to.equal(true, 'live_preview.enabled must be true');
190-
expect(preview["default-env"]).to.equal("", 'default-env must match');
191-
expect(preview["default-url"]).to.equal("https://preview.example.com", 'default-url must match');
198+
const preview = response.live_preview
199+
expect(preview.enabled).to.equal(true, 'live_preview.enabled must be true')
200+
expect(preview['default-env']).to.equal('', 'default-env must match')
201+
expect(preview['default-url']).to.equal('https://preview.example.com', 'default-url must match')
192202

193-
done();
194-
})
195-
.catch(done);
196-
});
203+
done()
204+
})
205+
.catch(done)
206+
})
197207

198208
it('should reset stack settings', done => {
199209
client.stack({ api_key: stacks.api_key })

0 commit comments

Comments
 (0)