Skip to content

Commit 4e89892

Browse files
committed
test(web): keep the two pre-existing composer style tests as they were
The unicode-flag cleanup only applies to the assertions this branch added; the padding and attachment-tile tests pre-date it.
1 parent 010614c commit 4e89892

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

apps/pythinker-web/test/composer.test.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -168,25 +168,29 @@ describe('Composer styling', () => {
168168
});
169169

170170
it('places the composer border flush against the message list', () => {
171-
const composerRule = capture(composerSource, /(?:^|\n)\.composer\s*\{([^}]*)\}/u);
171+
const composerRule = composerSource.match(/(?:^|\n)\.composer\s*\{([^}]*)\}/)?.[1] ?? '';
172+
expect(composerRule.trim()).not.toBe('');
172173

173-
const padding = capture(composerRule, /padding:\s*([^;]+);/u);
174-
expect(padding).toMatch(/^0(?:\s|$)/u);
175-
expect(padding).not.toMatch(/^7px(?:\s|$)/u);
176-
expect(padding).toMatch(/var\(--dock-inline-left, 16px\)$/u);
174+
const padding = composerRule.match(/padding:\s*([^;]+);/)?.[1] ?? '';
175+
expect(padding).toMatch(/^0(?:\s|$)/);
176+
expect(padding).not.toMatch(/^7px(?:\s|$)/);
177+
expect(padding).toMatch(/var\(--dock-inline-left, 16px\)$/);
177178
});
178179

179180
it('styles attachments as a horizontal row of square tiles', () => {
180-
const stripRule = capture(composerSource, /(?:^|\n)\.att-strip\s*\{([^}]*)\}/u);
181-
expect(stripRule).toMatch(/flex-wrap:\s*nowrap;/u);
182-
expect(stripRule).toMatch(/overflow-x:\s*auto;/u);
183-
184-
const removeRule = capture(composerSource, /(?:^|\n)\.att-rm\s*\{([^}]*)\}/u);
185-
expect(removeRule).toMatch(/opacity:\s*0;/u);
186-
expect(removeRule).not.toMatch(/display:\s*none;/u);
187-
188-
const chipRule = capture(composerSource, /(?:^|\n)\.att-chip\s*\{([^}]*)\}/u);
189-
expect(chipRule).toMatch(/width:\s*56px;/u);
181+
const stripRule = composerSource.match(/(?:^|\n)\.att-strip\s*\{([^}]*)\}/)?.[1] ?? '';
182+
expect(stripRule.trim()).not.toBe('');
183+
expect(stripRule).toMatch(/flex-wrap:\s*nowrap;/);
184+
expect(stripRule).toMatch(/overflow-x:\s*auto;/);
185+
186+
const removeRule = composerSource.match(/(?:^|\n)\.att-rm\s*\{([^}]*)\}/)?.[1] ?? '';
187+
expect(removeRule.trim()).not.toBe('');
188+
expect(removeRule).toMatch(/opacity:\s*0;/);
189+
expect(removeRule).not.toMatch(/display:\s*none;/);
190+
191+
const chipRule = composerSource.match(/(?:^|\n)\.att-chip\s*\{([^}]*)\}/)?.[1] ?? '';
192+
expect(chipRule.trim()).not.toBe('');
193+
expect(chipRule).toMatch(/width:\s*56px;/);
190194
});
191195
});
192196

0 commit comments

Comments
 (0)