feat(settings): adjust document actions layout to prevent button wrapping
This commit is contained in:
@@ -140,6 +140,32 @@ describe('SettingsPage — document filters', () => {
|
||||
expect(el.querySelector('.documents-table tbody tr')?.children.length).toBe(6);
|
||||
});
|
||||
|
||||
it('keeps row action buttons unwrapped inside the narrow عملیات column', () => {
|
||||
// Regression: the actions column used to be only 15% wide and inherited the
|
||||
// table's `overflow-wrap: anywhere`, so «تلاشمجدد» / «بازبینی سند» broke in
|
||||
// the middle of the word and the button looked broken.
|
||||
const fixture = TestBed.createComponent(SettingsPage);
|
||||
fixture.detectChanges();
|
||||
const el = fixture.nativeElement as HTMLElement;
|
||||
|
||||
const actionsCell = el.querySelector('.documents-table tbody tr td:last-child') as HTMLElement;
|
||||
expect(actionsCell).not.toBeNull();
|
||||
|
||||
const wrapper = actionsCell.querySelector('.documents-actions') as HTMLElement;
|
||||
expect(wrapper).not.toBeNull();
|
||||
|
||||
// Whatever renders inside must stay on a single line per button.
|
||||
const actionButtons = Array.from(wrapper.querySelectorAll('button'));
|
||||
expect(actionButtons.length).toBeGreaterThan(0);
|
||||
for (const button of actionButtons) {
|
||||
const style = getComputedStyle(button);
|
||||
if (button.classList.contains('btn')) {
|
||||
expect(style.whiteSpace).toBe('nowrap');
|
||||
expect(style.overflowWrap).toBe('normal');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it('confirms before removing: the bin button opens a modal, cancel keeps the doc, confirm shows the MVP notice', () => {
|
||||
const fixture = TestBed.createComponent(SettingsPage);
|
||||
fixture.detectChanges();
|
||||
|
||||
Reference in New Issue
Block a user