It is known that, in the chi-square test of the goodness of fit, the expected frequency of each cells should be greater than $5$ for the large sample theory to hold, and thus that, if there are cells with small observed frequencies, one should group them so that the new grouped cell has the observed frequency greater than $5$. In the present paper, we treat the problem of grouping of small cells in the test of goodness of fit from the viewpoint of a Bayes approach to the decision theoretic framework of model fitting proposed by Inagaki(1977b). Then we have two errors, one of which is caused by the estimation of probabilities of cells and the other by the grouping of small cells, and obtain the exact and asymptotic representations of two errors explicitly. By using them, we compare a new Bayes grouping rule of this model fitting to the usual grouping rule of small cells.