A low-frequency superconducting cavity is needed in main accelerators for storage ring light sources with ultralow emittance. A compact 166.6 MHz superconducting proof-of-principle cavity was designed adopting a quarter-wave β = 1 geometry for a High Energy Photon Source (HEPS). It is a 6 GeV diffraction-limited synchrotron light source currently being developed at the Institute of High Energy Physics. The cavity is exceedingly compact in size yet possessing a low resonant frequency. The nearest higher order mode is largely separated from the fundamental, making the cavity an attractive geometry for effective damping of these modes in high current accelerators such as HEPS. The achieved accelerating voltage of 3.0 MV is well beyond the designed 1.5 MV and required 1.2 MV for HEPS operation. High surface electromagnetic fields were reached with excellent rf and mechanical performances, and multipacting barriers were easily processed. This constitutes the first demonstration of a compact low-frequency β = 1 superconducting cavity for HEPS. The design, fabrication, surface preparation, and cryogenic tests of the cavity are presented.