Skip to content

Commit aeddc90

Browse files
committed
test(web): cover the http form layout and add the unicode regex flag
The layout test only checked the stdio branch, so a regression in the URL or Headers span could pass. It now asserts both branches. The three CSS assertions also carry the u flag the repo uses everywhere else.
1 parent f7f62c3 commit aeddc90

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

apps/pythinker-web/test/connectors-page.test.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,27 @@ describe('ConnectorsPage', () => {
9292

9393
await wrapper.get('button.act').trigger('click');
9494
const labelOf = (field: ReturnType<typeof wrapper.get>): string => field.get('.rlabel').text();
95-
const wide = wrapper.findAll('.connector-field-wide').map(labelOf);
96-
const narrow = wrapper
97-
.findAll('.connector-field')
98-
.filter((field) => !field.classes().includes('connector-field-wide'))
99-
.map(labelOf);
95+
const layout = (): { narrow: string[]; wide: string[] } => ({
96+
narrow: wrapper
97+
.findAll('.connector-field')
98+
.filter((field) => !field.classes().includes('connector-field-wide'))
99+
.map(labelOf),
100+
wide: wrapper.findAll('.connector-field-wide').map(labelOf),
101+
});
100102

101103
// Name and Transport pair up on the first row; the rest take a full row,
102104
// so no row is left half empty.
103-
expect(narrow).toEqual(['Name', 'Transport']);
104-
expect(wide).toEqual(['Command', 'Arguments', 'Environment (JSON)']);
105+
expect(layout()).toEqual({
106+
narrow: ['Name', 'Transport'],
107+
wide: ['Command', 'Arguments', 'Environment (JSON)'],
108+
});
109+
110+
await wrapper.get('select').setValue('http');
111+
112+
expect(layout()).toEqual({
113+
narrow: ['Name', 'Transport'],
114+
wide: ['URL', 'Headers (JSON)'],
115+
});
105116
});
106117

107118
it('shows the daemon validation message after a rejected write', () => {

apps/pythinker-web/test/provider-manager-chrome.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ describe('ProviderManager dialog chrome', () => {
2222
it('clips its children to the rounded corners', () => {
2323
const dialog = blockOf('.dialog');
2424

25-
expect(dialog).toMatch(/border-radius:\s*4px/);
26-
expect(dialog).toMatch(/overflow:\s*hidden/);
25+
expect(dialog).toMatch(/border-radius:\s*4px/u);
26+
expect(dialog).toMatch(/overflow:\s*hidden/u);
2727
});
2828

2929
it('leaves the corner rounding to the dialog instead of the footer', () => {
30-
expect(blockOf('.footer-hint')).not.toMatch(/border-radius/);
30+
expect(blockOf('.footer-hint')).not.toMatch(/border-radius/u);
3131
});
3232
});

0 commit comments

Comments
 (0)