Skip to content

Commit beae7f8

Browse files
committed
test(helpdesk): refactor fixtures to replace chat_id with created_chat
1 parent af7862f commit beae7f8

File tree

6 files changed

+16
-28
lines changed

6 files changed

+16
-28
lines changed

e2e_config.test.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@
5656
"commerce.product.listing.id": "LST-5489-0806",
5757
"commerce.product.template.id": "TPL-1767-7355-0002",
5858
"commerce.user.id": "USR-4303-2348",
59-
"helpdesk.chat.id": "CHT-5064-0262-3671",
60-
"helpdesk.channel.id": "CHL-5064-0262-3671",
6159
"commerce.subscription.agreement.id": "AGR-2473-3299-1721",
6260
"commerce.subscription.id": "SUB-3678-1831-2188",
6361
"commerce.subscription.product.item.id": "ITM-1767-7355-0001",

tests/e2e/helpdesk/channels/conftest.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
)
77

88

9-
@pytest.fixture(scope="session")
10-
def channel_id(e2e_config):
11-
return e2e_config["helpdesk.channel.id"] # FIXME: seed data
12-
13-
149
@pytest.fixture(scope="session")
1510
def invalid_channel_id():
1611
return "CHN-0000-0000-0000"

tests/e2e/helpdesk/chats/conftest.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
)
77

88

9-
@pytest.fixture(scope="session")
10-
def chat_id(e2e_config):
11-
return e2e_config["helpdesk.chat.id"]
12-
13-
149
@pytest.fixture(scope="session")
1510
def invalid_chat_id():
1611
return "CHT-0000-0000-0000"

tests/e2e/helpdesk/chats/participants/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88

99
@pytest.fixture
10-
def chat_participants_service(mpt_ops, chat_id):
11-
return mpt_ops.helpdesk.chats.participants(chat_id)
10+
def chat_participants_service(mpt_ops, created_chat):
11+
return mpt_ops.helpdesk.chats.participants(created_chat.id)
1212

1313

1414
@pytest.fixture
15-
def async_chat_participants_service(async_mpt_ops, chat_id):
16-
return async_mpt_ops.helpdesk.chats.participants(chat_id)
15+
def async_chat_participants_service(async_mpt_ops, created_chat):
16+
return async_mpt_ops.helpdesk.chats.participants(created_chat.id)
1717

1818

1919
@pytest.fixture

tests/e2e/helpdesk/chats/test_async_chats.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
pytestmark = [pytest.mark.flaky]
99

1010

11-
async def test_get_chat(async_mpt_ops, chat_id):
11+
async def test_get_chat(async_mpt_ops, created_chat):
1212
service = async_mpt_ops.helpdesk.chats
1313

14-
result = await service.get(chat_id)
14+
result = await service.get(created_chat.id)
1515

16-
assert result.id == chat_id
16+
assert result.id == created_chat.id
1717

1818

1919
async def test_list_chats(async_mpt_ops):
@@ -25,13 +25,13 @@ async def test_list_chats(async_mpt_ops):
2525
assert all(isinstance(chat, Chat) for chat in result)
2626

2727

28-
async def test_update_chat(async_mpt_ops, chat_id, short_uuid):
28+
async def test_update_chat(async_mpt_ops, created_chat, short_uuid):
2929
service = async_mpt_ops.helpdesk.chats
3030
new_description = f"e2e update {short_uuid}"
3131

32-
result = await service.update(chat_id, {"description": new_description})
32+
result = await service.update(created_chat.id, {"description": new_description})
3333

34-
assert result.id == chat_id
34+
assert result.id == created_chat.id
3535
assert result.to_dict().get("description") == new_description
3636

3737

tests/e2e/helpdesk/chats/test_sync_chats.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
pytestmark = [pytest.mark.flaky]
99

1010

11-
def test_get_chat(mpt_ops, chat_id):
11+
def test_get_chat(mpt_ops, created_chat):
1212
service = mpt_ops.helpdesk.chats
1313

14-
result = service.get(chat_id)
14+
result = service.get(created_chat.id)
1515

16-
assert result.id == chat_id
16+
assert result.id == created_chat.id
1717

1818

1919
def test_list_chats(mpt_ops):
@@ -25,13 +25,13 @@ def test_list_chats(mpt_ops):
2525
assert all(isinstance(chat, Chat) for chat in result)
2626

2727

28-
def test_update_chat(mpt_ops, chat_id, short_uuid):
28+
def test_update_chat(mpt_ops, created_chat, short_uuid):
2929
service = mpt_ops.helpdesk.chats
3030
new_description = f"e2e update {short_uuid}"
3131

32-
result = service.update(chat_id, {"description": new_description})
32+
result = service.update(created_chat.id, {"description": new_description})
3333

34-
assert result.id == chat_id
34+
assert result.id == created_chat.id
3535
assert result.to_dict().get("description") == new_description
3636

3737

0 commit comments

Comments
 (0)