mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 14:54:37 +00:00
Migrate all tests to TypeScript (#19)
* Merge 2 npm repos * Install ts-jest * Update jestconfig * Fix jest types * jest fix * Fix babel config ref issue * Fix import * Fix import meta issue * fix generate * Skip multi-user tests
This commit is contained in:
@@ -2,7 +2,7 @@ import { ComfyLogging } from "./logging";
|
||||
import { ComfyWidgetConstructor, ComfyWidgets, initWidgets } from "./widgets";
|
||||
import { ComfyUI, $el } from "./ui";
|
||||
import { api } from "./api";
|
||||
import { defaultGraph } from "./defaultGraph.js";
|
||||
import { defaultGraph } from "./defaultGraph";
|
||||
import { getPngMetadata, getWebpMetadata, importA1111, getLatentMetadata } from "./pnginfo";
|
||||
import { addDomClippingSetting } from "./domWidget";
|
||||
import { createImageHost, calculateImageGrid } from "./ui/imagePreview"
|
||||
@@ -1534,7 +1534,7 @@ export class ComfyApp {
|
||||
const users = userConfig.users ?? {};
|
||||
if (!user || !users[user]) {
|
||||
// This will rarely be hit so move the loading to on demand
|
||||
const { UserSelectionScreen } = await import("./ui/userSelection.js");
|
||||
const { UserSelectionScreen } = await import("./ui/userSelection");
|
||||
|
||||
this.ui.menuContainer.style.display = "none";
|
||||
const { userId, username, created } = await new UserSelectionScreen().show(users, user);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { addStylesheet } from "../utils";
|
||||
|
||||
// @ts-ignore
|
||||
addStylesheet(import.meta.url);
|
||||
|
||||
export function createSpinner() {
|
||||
|
||||
@@ -12,6 +12,7 @@ interface SelectedUser {
|
||||
export class UserSelectionScreen {
|
||||
async show(users, user): Promise<SelectedUser>{
|
||||
// This will rarely be hit so move the loading to on demand
|
||||
// @ts-ignore
|
||||
await addStylesheet(import.meta.url);
|
||||
const userSelection = document.getElementById("comfy-user-selection");
|
||||
userSelection.style.display = "";
|
||||
|
||||
Reference in New Issue
Block a user