Sub topic 12
Long text, empty states and missing images
This chapter assumes you can use DevTools to inspect and edit elements, and that you know basic CSS (overflow, flexbox, min-width). Designs usually show tidy sample content. Real content is longer, shorter, or absent. A visual QA pass should push the page past the sample data and check that it still holds together.
Why edge cases matter
A design file shows one state of each component, usually with a short name, a two-line description and a loaded image. The built page will meet a 60-character product title, a user with no orders, and an image URL that returns a 404. The design rarely says what should happen. Your job is to find out whether the page breaks, and to flag cases where the design is silent.
Long text
Edit the text directly in DevTools (double-click a text node in the Elements panel). Try these inputs:
- A single long word with no spaces, such as a URL or
Pneumonoultramicroscopicsilicovolcanoconiosis. - A title two or three times longer than the sample.
- A very short value, such as one character.
- Text in a language with longer words, such as German.
Look for text that overflows its box, pushes siblings out of place, is clipped with no way to read it, or overlaps neighbouring elements.
/* Common fixes to check for */
.card-title {
overflow-wrap: anywhere; /* break long words */
}
.card-summary {
display: -webkit-box;
-webkit-line-clamp: 3; /* truncate after three lines */
-webkit-box-orient: vertical;
overflow: hidden;
}A frequent flexbox gotcha: a flex child will not shrink below its content width unless it has min-width: 0. If a long title stretches a row past the viewport, check that first.
Empty states
An empty state is what a list, table or dashboard shows when it has no data. Clear the content in DevTools (delete the repeated items) or use a test account with no data. Check that:
- A message or illustration appears instead of a blank gap.
- A call to action is present if the design includes one.
- The container does not collapse to zero height or leave oversized padding.
Missing images
Block an image request in the DevTools Network panel (right-click the request, then choose to block it), or change the src to a bad path. Then check:
- Whether the layout shifts when the image fails.
- Whether a broken-image icon or alt text appears where a placeholder should be.
- Whether the image box keeps its size, for example through
aspect-ratioor fixedwidthandheightattributes.
.thumb {
aspect-ratio: 4 / 3;
object-fit: cover;
background: #e5e7eb; /* visible placeholder if the image fails */
}Recording what you find
For each failure, note the component, the input you used (the exact string or the blocked URL), the viewport width, and what you expected. Edge-case problems often appear only at narrow widths, so repeat the long-text test at the smallest breakpoint from the responsive chapter.
Exercise
A product card title overflows its card when you paste a 90-character title with no spaces. The card is a flex child and the title already has overflow-wrap: anywhere. Which property would you check next, and why?
Show answer
Check min-width: 0 on the flex child. A flex item will not shrink below its content's minimum width by default, so the long content can still stretch the item even when wrapping is allowed.
Exercise
Name two things to verify when an image fails to load, besides whether alt text appears.
Show answer
Whether the layout shifts (the image box should keep its reserved size, for example with aspect-ratio or width and height attributes), and whether a visible placeholder background or fallback appears where the image should be.