mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 10:56:15 -06:00
add test for deleting status edits
This commit is contained in:
parent
c913f604bf
commit
ca809d8cc0
1 changed files with 13 additions and 0 deletions
|
|
@ -114,7 +114,20 @@ func (suite *StatusEditTestSuite) TestGetStatusEditsByIDs() {
|
|||
}
|
||||
|
||||
func (suite *StatusEditTestSuite) TestDeleteStatusEdits() {
|
||||
// Create a new context for this test.
|
||||
ctx, cncl := context.WithCancel(context.Background())
|
||||
defer cncl()
|
||||
|
||||
for _, status := range suite.testStatuses {
|
||||
// Delete all edits for status with given IDs from database.
|
||||
err := suite.state.DB.DeleteStatusEdits(ctx, status.EditIDs)
|
||||
suite.NoError(err)
|
||||
|
||||
// Now attempt to fetch these edits from database, should be empty.
|
||||
edits, err := suite.state.DB.GetStatusEditsByIDs(ctx, status.EditIDs)
|
||||
suite.NoError(err)
|
||||
suite.Empty(edits)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStatusEditTestSuite(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue