Merge commit '52ab8a59c6' into glitch-soc/merge-upstream

This commit is contained in:
Claire 2024-05-01 17:30:52 +02:00
commit 0fb469e2f3
18 changed files with 125 additions and 42 deletions

View file

@ -3,7 +3,9 @@ import * as html from '../html';
describe('html', () => {
describe('unescapeHTML', () => {
it('returns unescaped HTML', () => {
const output = html.unescapeHTML('<p>lorem</p><p>ipsum</p><br>&lt;br&gt;');
const output = html.unescapeHTML(
'<p>lorem</p><p>ipsum</p><br>&lt;br&gt;',
);
expect(output).toEqual('lorem\n\nipsum\n<br>');
});
});

View file

@ -0,0 +1,24 @@
import { DECIMAL_UNITS, toShortNumber } from '../numbers';
interface TableRow {
input: number;
base: number;
unit: number;
digits: number;
}
describe.each`
input | base | unit | digits
${10_000_000} | ${10} | ${DECIMAL_UNITS.MILLION} | ${0}
${2_789_123} | ${2.789123} | ${DECIMAL_UNITS.MILLION} | ${1}
${12_345_789} | ${12.345789} | ${DECIMAL_UNITS.MILLION} | ${0}
${10_000_000_000} | ${10} | ${DECIMAL_UNITS.BILLION} | ${0}
${12} | ${12} | ${DECIMAL_UNITS.ONE} | ${0}
${123} | ${123} | ${DECIMAL_UNITS.ONE} | ${0}
${1234} | ${1.234} | ${DECIMAL_UNITS.THOUSAND} | ${1}
${6666} | ${6.666} | ${DECIMAL_UNITS.THOUSAND} | ${1}
`('toShortNumber', ({ input, base, unit, digits }: TableRow) => {
test(`correctly formats ${input}`, () => {
expect(toShortNumber(input)).toEqual([base, unit, digits]);
});
});

View file

@ -112,9 +112,11 @@
border: 0;
}
&:focus,
&:active {
&:active,
&:focus {
outline: none !important;
border-width: 1px !important;
border-color: $ui-button-background-color;
}
&::-webkit-search-cancel-button {