Skip to content

Commit 15dd3ec

Browse files
committed
MC-29423: GraphQL Send Friend is still sending emails when disabled
- use snake case for field names
1 parent fcda68c commit 15dd3ec

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

app/code/Magento/SendFriendGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type SendEmailToFriendRecipient {
3939
}
4040

4141
type StoreConfig {
42-
sendFriend: SendFriendConfiguration @resolver(class: "\\Magento\\SendFriendGraphQl\\Model\\Resolver\\SendFriendConfiguration") @doc(description: "Email to a Friend configuration.")
42+
send_friend: SendFriendConfiguration @resolver(class: "\\Magento\\SendFriendGraphQl\\Model\\Resolver\\SendFriendConfiguration") @doc(description: "Email to a Friend configuration.")
4343
}
4444

4545
type SendFriendConfiguration {

dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/StoreConfigTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public function testSendFriendFieldsAreReturnedWithoutError()
2020

2121
$response = $this->graphQlQuery($query);
2222
$this->assertArrayNotHasKey('errors', $response);
23-
$this->assertArrayHasKey('sendFriend', $response['storeConfig']);
24-
$this->assertArrayHasKey('enabled_for_customers', $response['storeConfig']['sendFriend']);
25-
$this->assertArrayHasKey('enabled_for_guests', $response['storeConfig']['sendFriend']);
26-
$this->assertNotNull($response['storeConfig']['sendFriend']['enabled_for_customers']);
27-
$this->assertNotNull($response['storeConfig']['sendFriend']['enabled_for_guests']);
23+
$this->assertArrayHasKey('send_friend', $response['storeConfig']);
24+
$this->assertArrayHasKey('enabled_for_customers', $response['storeConfig']['send_friend']);
25+
$this->assertArrayHasKey('enabled_for_guests', $response['storeConfig']['send_friend']);
26+
$this->assertNotNull($response['storeConfig']['send_friend']['enabled_for_customers']);
27+
$this->assertNotNull($response['storeConfig']['send_friend']['enabled_for_guests']);
2828
}
2929

3030
/**
@@ -77,11 +77,11 @@ public function testSendFriendEnabledGuestEnabled()
7777
private function assertResponse(array $expectedValues, array $response)
7878
{
7979
$this->assertArrayNotHasKey('errors', $response);
80-
$this->assertArrayHasKey('sendFriend', $response['storeConfig']);
81-
$this->assertArrayHasKey('enabled_for_customers', $response['storeConfig']['sendFriend']);
82-
$this->assertArrayHasKey('enabled_for_guests', $response['storeConfig']['sendFriend']);
83-
$this->assertEquals($expectedValues['enabled_for_customers'], $response['storeConfig']['sendFriend']['enabled_for_customers']);
84-
$this->assertEquals($expectedValues['enabled_for_guests'], $response['storeConfig']['sendFriend']['enabled_for_guests']);
80+
$this->assertArrayHasKey('send_friend', $response['storeConfig']);
81+
$this->assertArrayHasKey('enabled_for_customers', $response['storeConfig']['send_friend']);
82+
$this->assertArrayHasKey('enabled_for_guests', $response['storeConfig']['send_friend']);
83+
$this->assertEquals($expectedValues['enabled_for_customers'], $response['storeConfig']['send_friend']['enabled_for_customers']);
84+
$this->assertEquals($expectedValues['enabled_for_guests'], $response['storeConfig']['send_friend']['enabled_for_guests']);
8585
}
8686

8787
/**
@@ -95,7 +95,7 @@ private function getStoreConfigQuery()
9595
{
9696
storeConfig{
9797
id
98-
sendFriend {
98+
send_friend {
9999
enabled_for_customers
100100
enabled_for_guests
101101
}

0 commit comments

Comments
 (0)