Skip to content

Commit

Permalink
Skip support info from result
Browse files Browse the repository at this point in the history
  • Loading branch information
berejant committed Sep 27, 2024
1 parent cea1ba6 commit 3546b07
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Test2EnsureAuthFlow.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ func Test2EnsureAuthFlow(t *testing.T) {
catchMessage.Text = strings.Trim(catchMessage.Text, " \n")
lines := strings.Split(catchMessage.Text, "\n")

lastLineContent := "Цей Бот не є офіційним джерелом даних про успішність."

lastLineIndex := len(lines) - 1
for index, line := range lines {
// found last line in case if there is SupportInfo
if strings.Contains(line, lastLineContent) {
lastLineIndex = index
}
}
lines = lines[:lastLineIndex+1]

if !assert.GreaterOrEqual(t, len(lines), 5) {
return
}
Expand All @@ -75,7 +86,7 @@ func Test2EnsureAuthFlow(t *testing.T) {
assert.Equal(t, "Вимкнути бот - /reset", lines[len(lines)-5])
assert.Equal(t, "❗Увага❗", lines[len(lines)-3])
assert.Equal(t, "Перевіряйте оцінки в [офіційному журналі успішності КНЕУ](https://cutt.ly/Dekanat)", lines[len(lines)-2])
assert.Equal(t, "Цей Бот не є офіційним джерелом даних про успішність.", lines[len(lines)-1])
assert.Equal(t, lastLineContent, lines[len(lines)-1])

// 7. press discipline button
firstButton := catchMessage.GetInlineButton(0)
Expand Down

0 comments on commit 3546b07

Please sign in to comment.