If you haven’t cooked the quinoa yet, begin by doing that, then set aside and proceed with the recipe (you can cook the quinoa a day ahead).
Preheat the oven to 375. Warm the olive oil in a large skillet over medium heat. Add the chopped onion and a pinch of salt and cook until softened, about 8 minutes. Stir in the garlic and all of the spices (oregano, allspice, chili, salt and cocoa), and cook another 1-2 minutes, adjusting the heat if the garlic looks like it is going to burn.
Pour in the tomatoes and bring to a simmer. Cook until thickened, about 10-15 minutes. If it is splattering adjust the heat, or partially cover with a lid.
Add the beans and cooked quinoa. Taste for seasoning and add more salt, which it will likely need. Pour into a casserole dish, I like a deep 9 x 13 dish, and set aside while you make the topping.