Client script not functioning

I have this client script on the ‘Item’ DocType, with a custom field of type Data, named ‘test’.
I have the ‘enabled’ tick box clicked and client_script_enabled = True on the site config.
The field does not change with a load/refresh. I also tried to get it to throw an error but nothing. I’m trying to check the logs but I’m running in docker, not sure which container holds the logs for this.

frappe.ui.form.on('Item', {
	refresh(frm) {
        frm.doc.test = 2;
	}
});

I added the code I’m actually going to use and it works now. :man_shrugging:

frappe.ui.form.on('Item', {
	onload(frm) {
        function getItemVariantAttributes(itemCode) {
            var item = frappe.get_doc("Item", itemCode);
            if (!item || !item.attributes) return;

            var variantAttributes = [];
            item.attributes.forEach(function(attribute) {
            variantAttributes.push(attribute.attribute_value);
        });
        return variantAttributes;
        }
        frm.doc.test = getItemVariantAttributes(frm.doc.item_code);
	}
});