chore: Standardize code, comments and docs on US-English spelling (#2707)
This commit is contained in:
@@ -92,7 +92,7 @@ export const tabUntil = async (
|
||||
|
||||
/**
|
||||
* Click an element with a real pointer, which is the only kind that carries the
|
||||
* browser's own behaviour: the press moves focus, and an element that stops the
|
||||
* browser's own behavior: the press moves focus, and an element that stops the
|
||||
* press doing so leaves it where it was.
|
||||
*/
|
||||
export const clickElement = async (element: Element): Promise<void> =>
|
||||
|
||||
@@ -92,12 +92,12 @@ const createRegistryEntry = (entityID: string, overrides?: Partial<Entity>): Ent
|
||||
* A driveable stand-in for the `hass` object the card is handed by Home
|
||||
* Assistant.
|
||||
*
|
||||
* Home Assistant updates immutably, and that is the behaviour reproduced here:
|
||||
* a change hands consumers a new top-level object and a new `states` map
|
||||
* holding a new state object for the entity that changed, while every other
|
||||
* entity keeps the object it already had. Anything the card can observe about
|
||||
* a real `hass` it must be able to observe about this one, so a divergence here
|
||||
* is a bug in the fake rather than a shortcut worth taking.
|
||||
* Home Assistant updates immutably, and that is the behavior reproduced here: a
|
||||
* change hands consumers a new top-level object and a new `states` map holding
|
||||
* a new state object for the entity that changed, while every other entity
|
||||
* keeps the object it already had. Anything the card can observe about a real
|
||||
* `hass` it must be able to observe about this one, so a divergence here is a
|
||||
* bug in the fake rather than a shortcut worth taking.
|
||||
*/
|
||||
export class FakeHASS {
|
||||
private _hass: HomeAssistant;
|
||||
|
||||
@@ -40,8 +40,8 @@ class HAPlayerStandIn extends LitElement {
|
||||
}
|
||||
|
||||
/**
|
||||
* A stand-in that renders its children and nothing else. Behaviour is added
|
||||
* only for elements the card is observed to depend on.
|
||||
* A stand-in that renders its children and nothing else. Behavior is added only
|
||||
* for elements the card is observed to depend on.
|
||||
*/
|
||||
class HAElementStub extends LitElement {
|
||||
static styles = css`
|
||||
|
||||
@@ -158,11 +158,11 @@ interface EventEntry {
|
||||
target: EventTarget | null;
|
||||
}
|
||||
|
||||
interface LabelledElement extends Element {
|
||||
interface LabeledElement extends Element {
|
||||
label?: string;
|
||||
}
|
||||
|
||||
const hasLabel = (element: Element): element is LabelledElement => 'label' in element;
|
||||
const hasLabel = (element: Element): element is LabeledElement => 'label' in element;
|
||||
|
||||
/**
|
||||
* What a control calls itself to the user. The card titles the controls it
|
||||
|
||||
@@ -36,7 +36,7 @@ const HOME_ASSISTANT_THEME = `
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
|
||||
/* A dashboard sits the card on the background colour with room around it. */
|
||||
/* A dashboard sits the card on the background color with room around it. */
|
||||
body {
|
||||
background: var(--primary-background-color);
|
||||
margin: 0;
|
||||
|
||||
@@ -87,13 +87,13 @@ export const getTestMediaRequestCount = (url: string): number => {
|
||||
/**
|
||||
* Serves a fixture at `/test-media/<file>`, behaving as the query asks:
|
||||
*
|
||||
* token Which counter the request belongs to, so that a test's
|
||||
* behaviour does not depend on what ran before it.
|
||||
* responses The status to answer each request with, in order: `200` serves
|
||||
* the file and anything else is sent as an empty error.
|
||||
* repeat What to do once the `responses` list is exhausted: answer every
|
||||
* request after it as the last one was, or never answer again
|
||||
* (i.e. camera going quiet).
|
||||
* token Which counter the request belongs to, so that a test's behavior
|
||||
* does not depend on what ran before it. responses The status to
|
||||
* answer each request with, in order: `200` serves the file and
|
||||
* anything else is sent as an empty error. repeat What to do
|
||||
* once the `responses` list is exhausted: answer every request
|
||||
* after it as the last one was, or never answer again (i.e. camera
|
||||
* going quiet).
|
||||
*
|
||||
* Answered from within the page rather than by a server, because a request the
|
||||
* page is still waiting on holds one of the handful of connections a browser
|
||||
|
||||
Reference in New Issue
Block a user