import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';

export const getUniDriverStyle = async (el: UniDriver) => {
  const style = await el.attr('style');
  return (style ?? '').split(';').reduce((acc, prop) => {
    const [key = '', value = ''] = prop.split(':');
    acc[key.trim()] = value.trim();
    return acc;
  }, {} as Record<string, string>);
};
