Skip to content

feat(coderd): remove greetings from notifications templates #16991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Mar 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert test
  • Loading branch information
defelmnq committed Mar 20, 2025
commit 3a49b58282d63875a4fb2e34fb216b836a36abff
29 changes: 18 additions & 11 deletions coderd/inboxnotifications_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestInboxNotification_Watch(t *testing.T) {
firstUser := coderdtest.CreateFirstUser(t, client)
client, _ = coderdtest.CreateAnotherUser(t, client, firstUser.OrganizationID)

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()

resp, err := client.Request(ctx, http.MethodGet, "/api/v2/notifications/inbox/watch", nil,
Expand All @@ -86,7 +86,7 @@ func TestInboxNotification_Watch(t *testing.T) {
t.Run("OK", func(t *testing.T) {
t.Parallel()

ctx := testutil.Context(t, testutil.WaitSuperLong)
ctx := testutil.Context(t, testutil.WaitLong)
logger := testutil.Logger(t)

db, ps := dbtestutil.NewDB(t)
Expand Down Expand Up @@ -122,7 +122,8 @@ func TestInboxNotification_Watch(t *testing.T) {
}, "notification title", "notification content", nil)
require.NoError(t, err)

dispatchFunc(ctx, uuid.New())
_, err = dispatchFunc(ctx, uuid.New())
require.NoError(t, err)

_, message, err := wsConn.Read(ctx)
require.NoError(t, err)
Expand All @@ -138,7 +139,7 @@ func TestInboxNotification_Watch(t *testing.T) {
t.Run("OK - filters on templates", func(t *testing.T) {
t.Parallel()

ctx := testutil.Context(t, testutil.WaitSuperLong)
ctx := testutil.Context(t, testutil.WaitLong)
logger := testutil.Logger(t)

db, ps := dbtestutil.NewDB(t)
Expand Down Expand Up @@ -174,7 +175,8 @@ func TestInboxNotification_Watch(t *testing.T) {
}, "memory related title", "memory related content", nil)
require.NoError(t, err)

dispatchFunc(ctx, uuid.New())
_, err = dispatchFunc(ctx, uuid.New())
require.NoError(t, err)

_, message, err := wsConn.Read(ctx)
require.NoError(t, err)
Expand All @@ -193,15 +195,17 @@ func TestInboxNotification_Watch(t *testing.T) {
}, "disk related title", "disk related title", nil)
require.NoError(t, err)

dispatchFunc(ctx, uuid.New())
_, err = dispatchFunc(ctx, uuid.New())
require.NoError(t, err)

dispatchFunc, err = inboxHandler.Dispatcher(types.MessagePayload{
UserID: memberClient.ID.String(),
NotificationTemplateID: notifications.TemplateWorkspaceOutOfMemory.String(),
}, "second memory related title", "second memory related title", nil)
require.NoError(t, err)

dispatchFunc(ctx, uuid.New())
_, err = dispatchFunc(ctx, uuid.New())
require.NoError(t, err)

_, message, err = wsConn.Read(ctx)
require.NoError(t, err)
Expand All @@ -217,7 +221,7 @@ func TestInboxNotification_Watch(t *testing.T) {
t.Run("OK - filters on targets", func(t *testing.T) {
t.Parallel()

ctx := testutil.Context(t, testutil.WaitSuperLong)
ctx := testutil.Context(t, testutil.WaitLong)
logger := testutil.Logger(t)

db, ps := dbtestutil.NewDB(t)
Expand Down Expand Up @@ -256,7 +260,8 @@ func TestInboxNotification_Watch(t *testing.T) {
}, "memory related title", "memory related content", nil)
require.NoError(t, err)

dispatchFunc(ctx, uuid.New())
_, err = dispatchFunc(ctx, uuid.New())
require.NoError(t, err)

_, message, err := wsConn.Read(ctx)
require.NoError(t, err)
Expand All @@ -276,7 +281,8 @@ func TestInboxNotification_Watch(t *testing.T) {
}, "second memory related title", "second memory related title", nil)
require.NoError(t, err)

dispatchFunc(ctx, uuid.New())
_, err = dispatchFunc(ctx, uuid.New())
require.NoError(t, err)

dispatchFunc, err = inboxHandler.Dispatcher(types.MessagePayload{
UserID: memberClient.ID.String(),
Expand All @@ -285,7 +291,8 @@ func TestInboxNotification_Watch(t *testing.T) {
}, "another memory related title", "another memory related title", nil)
require.NoError(t, err)

dispatchFunc(ctx, uuid.New())
_, err = dispatchFunc(ctx, uuid.New())
require.NoError(t, err)

_, message, err = wsConn.Read(ctx)
require.NoError(t, err)
Expand Down
Loading