Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-13291-changed-1768826983961.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

Logs texts updates after tech writing review ([#13291](https://github.com/linode/manager/pull/13291))
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ function deleteDestinationViaActionMenu(
ui.actionMenuItem.findByTitle('Delete').click();

// Find confirmation modal
cy.findByText(
`Are you sure you want to delete "${destination.label}" destination?`
);
cy.findByText(`Are you sure you want to delete "${destination.label}"?`);
ui.button.findByTitle('Delete').click();

cy.wait('@deleteDestination');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { getDestinationTypeOption } from 'src/features/Delivery/deliveryUtils';
import type { AkamaiObjectStorageDetailsExtended } from '@linode/api-v4';

describe('Edit Destination', () => {
const saveChangesButtonText = 'Save Changes';

beforeEach(() => {
mockAppendFeatureFlags({
aclpLogs: {
Expand Down Expand Up @@ -48,7 +50,9 @@ describe('Edit Destination', () => {
);

// Save button should be disabled before test connection
cy.findByRole('button', { name: 'Save' }).should('be.disabled');
cy.findByRole('button', { name: saveChangesButtonText }).should(
'be.disabled'
);
// Test connection of the destination form
mockTestConnection(400);
ui.button
Expand All @@ -62,7 +66,9 @@ describe('Edit Destination', () => {
);

// Save button should be disabled after test connection failed
cy.findByRole('button', { name: 'Save' }).should('be.disabled');
cy.findByRole('button', { name: saveChangesButtonText }).should(
'be.disabled'
);
});

it('edit destination with correct data', () => {
Expand All @@ -75,7 +81,9 @@ describe('Edit Destination', () => {
);

// Save button should be disabled before test connection
cy.findByRole('button', { name: 'Save' }).should('be.disabled');
cy.findByRole('button', { name: saveChangesButtonText }).should(
'be.disabled'
);
// Test connection of the destination form
mockTestConnection();
ui.button
Expand All @@ -92,7 +100,7 @@ describe('Edit Destination', () => {
mockUpdateDestination(mockDestinationPayloadWithId, updatedDestination);
mockGetDestinations([updatedDestination]);
// Submit the destination edit form
cy.findByRole('button', { name: 'Save' })
cy.findByRole('button', { name: saveChangesButtonText })
.should('be.enabled')
.should('have.attr', 'type', 'button')
.click();
Expand Down
28 changes: 15 additions & 13 deletions packages/manager/cypress/e2e/core/delivery/edit-stream.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import { kubernetesClusterFactory } from 'src/factories';

describe('Edit Stream', () => {
const saveChangesButtonText = 'Save Changes';

beforeEach(() => {
mockAppendFeatureFlags({
aclpLogs: {
Expand All @@ -48,14 +50,14 @@
const updatedLabel = randomLabel();

// Change the Name
cy.findByLabelText('Name')
cy.findByLabelText('Stream Name')

Check warning on line 53 in packages/manager/cypress/e2e/core/delivery/edit-stream.spec.ts

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog ๐Ÿถ Define a constant instead of duplicating this literal 4 times. Raw Output: {"ruleId":"sonarjs/no-duplicate-string","severity":1,"message":"Define a constant instead of duplicating this literal 4 times.","line":53,"column":26,"nodeType":"Literal","endLine":53,"endColumn":39}
.should('be.visible')
.should('be.enabled')
.should('have.value', mockAuditLogsStream.label);

logsStreamForm.setLabel(updatedLabel);

cy.findByLabelText('Name')
cy.findByLabelText('Stream Name')
.should('be.visible')
.should('be.enabled')
.should('have.value', updatedLabel);
Expand All @@ -67,7 +69,7 @@
.should('have.attr', 'value', 'Audit Logs');

// Save button should be enabled initially
ui.button.findByTitle('Save').should('be.enabled');
ui.button.findByTitle(saveChangesButtonText).should('be.enabled');

// Test Connection should be disabled for existing destination
ui.button.findByTitle('Test Connection').should('be.disabled');
Expand All @@ -82,7 +84,7 @@
ui.button.findByTitle('Test Connection').should('be.enabled');

// Save button should be disabled after changing destination
ui.button.findByTitle('Save').should('be.disabled');
ui.button.findByTitle(saveChangesButtonText).should('be.disabled');

// Test connection with failure
mockTestConnection(400);
Expand All @@ -93,7 +95,7 @@
);

// Save button should remain disabled after failed test
ui.button.findByTitle('Save').should('be.disabled');
ui.button.findByTitle(saveChangesButtonText).should('be.disabled');

// Test connection with success
mockTestConnection(200);
Expand All @@ -104,11 +106,11 @@
);

// Save button should now be enabled
ui.button.findByTitle('Save').should('be.enabled');
ui.button.findByTitle(saveChangesButtonText).should('be.enabled');

// Submit the stream edit form - failure in creating destination
mockCreateDestination({}, 400);
ui.button.findByTitle('Save').should('be.enabled').click();
ui.button.findByTitle(saveChangesButtonText).should('be.enabled').click();

ui.toast.assertMessage(`There was an issue creating your destination`);

Expand All @@ -123,7 +125,7 @@
mockAuditLogsStream
).as('updateStream');

ui.button.findByTitle('Save').click();
ui.button.findByTitle(saveChangesButtonText).click();
cy.wait('@updateStream')
.its('request.body')
.then((body) => {
Expand Down Expand Up @@ -176,14 +178,14 @@
const updatedLabel = randomLabel();

// Change the Name
cy.findByLabelText('Name')
cy.findByLabelText('Stream Name')
.should('be.visible')
.should('be.enabled')
.should('have.value', mockLKEAuditLogsStream.label);

logsStreamForm.setLabel(updatedLabel);

cy.findByLabelText('Name')
cy.findByLabelText('Stream Name')
.should('be.visible')
.should('be.enabled')
.should('have.value', updatedLabel);
Expand Down Expand Up @@ -229,7 +231,7 @@
logsStreamForm.findClusterCheckbox('all').check();

// Save button should be enabled
ui.button.findByTitle('Save').should('be.enabled');
ui.button.findByTitle(saveChangesButtonText).should('be.enabled');

// Submit the stream edit form - failure
mockUpdateStream(
Expand All @@ -246,7 +248,7 @@
400
).as('updateStreamFail');

ui.button.findByTitle('Save').click();
ui.button.findByTitle(saveChangesButtonText).click();
cy.wait('@updateStreamFail');
ui.toast.assertMessage('There was an issue editing your stream');

Expand All @@ -264,7 +266,7 @@
mockLKEAuditLogsStream
).as('updateStream');

ui.button.findByTitle('Save').click();
ui.button.findByTitle(saveChangesButtonText).click();
cy.wait('@updateStream')
.its('request.body')
.then((body) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ function deleteStreamViaActionMenu(tableAlias: string, stream: Stream) {
ui.actionMenuItem.findByTitle('Delete').click();

// Find confirmation modal
cy.findByText(
`Are you sure you want to delete "${stream.label}" stream?`
);
cy.findByText(`Are you sure you want to delete "${stream.label}"?`);
ui.button.findByTitle('Delete').click();

cy.wait('@deleteStream');
Expand Down Expand Up @@ -115,7 +113,7 @@ function deactivateStreamViaActionMenu(tableAlias: string, stream: Stream) {
// Deactivate stream
ui.actionMenuItem.findByTitle('Deactivate').click();

ui.toast.assertMessage(`Stream ${stream.label} deactivated`);
ui.toast.assertMessage(`${stream.label} deactivated`);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const logsDestinationForm = {
cy.findByLabelText('Destination Name')
.should('be.visible')
.should('be.enabled')
.should('have.attr', 'placeholder', 'Destination Name')
.clear();
cy.focused().type(label);
},
Expand All @@ -30,7 +29,7 @@ export const logsDestinationForm = {
cy.findByLabelText('Host')
.should('be.visible')
.should('be.enabled')
.should('have.attr', 'placeholder', 'Host')
.should('have.attr', 'placeholder', 'Host for the destination')
.clear();
cy.focused().type(host);
},
Expand Down
15 changes: 11 additions & 4 deletions packages/manager/cypress/support/ui/pages/logs-stream-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ export const logsStreamForm = {
* @param label - stream label to set
*/
setLabel: (label: string) => {
cy.findByLabelText('Name')
cy.findByLabelText('Stream Name')
.should('be.visible')
.should('be.enabled')
.should('have.attr', 'placeholder', 'Stream name')
.clear();
cy.focused().type(label);
},
Expand Down Expand Up @@ -57,7 +56,11 @@ export const logsStreamForm = {
cy.findByLabelText('Destination Name')
.should('be.visible')
.should('be.enabled')
.should('have.attr', 'placeholder', 'Create or Select Destination Name')
.should(
'have.attr',
'placeholder',
'Select existing or enter new destination'
)
.clear();
// Select the Destination Name
ui.autocompletePopper
Expand Down Expand Up @@ -93,7 +96,11 @@ export const logsStreamForm = {
cy.findByLabelText('Destination Name')
.should('be.visible')
.should('be.enabled')
.should('have.attr', 'placeholder', 'Create or Select Destination Name')
.should(
'have.attr',
'placeholder',
'Select existing or enter new destination'
)
.clear();
cy.focused().type(label);
cy.findByText(new RegExp(`"${label}"`)).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ export const DeleteDestinationDialog = React.memo((props: Props) => {
open={open}
title="Delete Destination"
>
Are you sure you want to delete "{destination?.label}"
destination?
Are you sure you want to delete "{destination?.label}"?
</ConfirmationDialog>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('DestinationEdit', () => {

describe('given Test Connection and Edit Destination buttons', () => {
const testConnectionButtonText = 'Test Connection';
const saveDestinationButtonText = 'Save';
const saveDestinationButtonText = 'Save Changes';
const editDestinationSpy = vi.fn();
const verifyDestinationSpy = vi.fn();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export const DestinationForm = (props: DestinationFormProps) => {
onChange={(value) => {
field.onChange(value);
}}
placeholder="Destination Name"
value={field.value}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
onChange={(value) => {
field.onChange(value);
}}
placeholder="Host"
placeholder="Host for the destination"
value={field.value}
/>
)}
Expand Down Expand Up @@ -140,7 +140,7 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
label="Log Path Prefix"
onBlur={field.onBlur}
onChange={(value) => field.onChange(value)}
placeholder="Log Path Prefix"
placeholder="Prefix for log storage path"
sx={{ maxWidth: 416 }}
value={field.value}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('StreamFormSubmitBar', () => {
describe('and in edit mode', () => {
it('should render enabled Edit Stream button', async () => {
renderComponent('stream', 'edit');
const submitButton = screen.getByText('Save');
const submitButton = screen.getByText('Save Changes');

expect(submitButton).toBeEnabled();
});
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('StreamFormSubmitBar', () => {
describe('and in edit mode', () => {
it('should render enabled Edit Destination button', async () => {
renderComponent('destination', 'edit');
const submitButton = screen.getByText('Save');
const submitButton = screen.getByText('Save Changes');

expect(submitButton).toBeEnabled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export const FormSubmitBar = (props: StreamFormSubmitBarProps) => {
const enableSubmit = !blockSubmit || connectionTested;
const buttonLabel = useMemo(
() =>
mode === 'edit' ? 'Save' : `${capitalize(mode)} ${capitalizedFormType}`,
mode === 'edit'
? 'Save Changes'
: `${capitalize(mode)} ${capitalizedFormType}`,
[mode, capitalizedFormType]
);
const pagePendoId = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const DeleteStreamDialog = React.memo((props: Props) => {
open={open}
title="Delete Stream"
>
Are you sure you want to delete &#34;{stream?.label}&#34; stream?
Are you sure you want to delete &#34;{stream?.label}&#34;?
</ConfirmationDialog>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const StreamFormDelivery = (props: StreamFormDeliveryProps) => {
options={destinationNameOptions.filter(
({ type }) => type === selectedDestinationType
)}
placeholder="Create or Select Destination Name"
placeholder="Select existing or enter new destination"
renderOption={(props, option) => {
const { id, ...optionProps } = props;
return (
Expand Down Expand Up @@ -246,7 +246,7 @@ export const StreamFormDelivery = (props: StreamFormDeliveryProps) => {
<Paper>
<Typography variant="h2">Delivery</Typography>
<Typography sx={{ mt: theme.spacingFunction(12) }}>
Define a destination where you want this stream to send logs.
Set the destination for log delivery.
</Typography>
{isLoading && (
<Box display="flex" justifyContent="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('StreamCreate', () => {
const createStreamButtonText = 'Create Stream';

const fillOutFormWithNewDestination = async () => {
const streamNameInput = screen.getByLabelText('Name');
const streamNameInput = screen.getByLabelText('Stream Name');
await userEvent.type(streamNameInput, 'Test');
const destinationNameInput = screen.getByLabelText('Destination Name');
await userEvent.type(destinationNameInput, 'Test destination name');
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('StreamCreate', () => {
renderStreamCreate();

// Fill out form and select existing destination
const streamNameInput = screen.getByLabelText('Name');
const streamNameInput = screen.getByLabelText('Stream Name');
await userEvent.type(streamNameInput, 'Test');
const destinationNameInput =
screen.getByLabelText('Destination Name');
Expand Down
Loading