mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] test/helpers: useLogLifeCycle supports custom key
This commit is contained in:
committed by
Aaron Bohy
parent
1775467434
commit
38f39b6755
+5
-2
@@ -137,9 +137,12 @@ const steps: string[] = [];
|
||||
export function logStep(step: string) {
|
||||
steps.push(step);
|
||||
}
|
||||
export function useLogLifecycle() {
|
||||
export function useLogLifecycle(key?: string) {
|
||||
const component = useComponent();
|
||||
const name = component.constructor.name;
|
||||
let name = component.constructor.name;
|
||||
if (key) {
|
||||
name = `${name} (${key})`;
|
||||
}
|
||||
logStep(`${name}:setup`);
|
||||
expect(name + ": " + status(component)).toBe(name + ": " + "new");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user