China is interesting. Their relations with Russia are ones of convenience. You're right that they'll be willing to take on short term hard ship for long term goals and that short term is years for them but they wont stick their neck out for Russia. Their abstentions in the UN votes on Ukraine show you their connection with Russia is hardly dogmatic. Russia is useful, even a pariah state Russia is useful for them. But if Russia outlives its usefulness they'll toss it aside without a second thought.
I honestly don't know what China's long term goals are. They definitely want power and prestige but how much influence do they want? Or better yet, how much would they use it? They definitely want the influence that being a super power would give them so they could use it for their own benefit but but I don't see them taking on a role of trying to spread culture or ideals as the US has done. China still has isolationist tendencies and I don't see that changing.
China wins either way with this Ukraine conflict.
They can gouge Russia on anything because they're the only major country willing to trade with them. But strategically, it works for China because:
They can see how much the West will tolerate Russian aggression.
They can see the lengths the US and allies are willing to go to stop Putin without military action and only sanctions.
They can see how much money Putin is burning through this conflict, to help gauge how much they'd need to invade Taiwan.
They can see how sustainable an insurgency can be with West backed supplies and money.
Russia is doing a test-run for them, and they don't have to pay anything for it. They might actually come out profitting on this somehow.
And now that Putin is stretching his military thin, just on one country alone, it positions China to be the true #2 military power in the world, without actually having to lift a finger. It will take a long time for Putin to reload the military, with his economy in a black hole.