The test to compare proportions of successes in a categorical variable across groups of another categorical variable is called a chi-square test of independence. The chi-square goodness of fit test compares proportions of each level of a categorical variable to hypothesized values. Before running such a test, it can be helpful to visually compare the distribution in the sample to the hypothesized distribution.