From 4173f02097500c7b084c0dfe4351810841de650c Mon Sep 17 00:00:00 2001 From: Michael Alderete Date: Fri, 3 Nov 2023 17:03:00 -0700 Subject: [PATCH 1/6] Revisions to fileUpload component Edit and add comments. Refactoring. Minor functional changes. New bugs (probably). --- .../default/lwc/fileUpload/fileUpload.html | 82 ++++++++++--------- .../main/default/lwc/fileUpload/fileUpload.js | 53 ++++++++---- .../lwc/fileUpload/fileUpload.js-meta.xml | 10 ++- 3 files changed, 88 insertions(+), 57 deletions(-) diff --git a/force-app/main/default/lwc/fileUpload/fileUpload.html b/force-app/main/default/lwc/fileUpload/fileUpload.html index 460311b..fbbb5a5 100644 --- a/force-app/main/default/lwc/fileUpload/fileUpload.html +++ b/force-app/main/default/lwc/fileUpload/fileUpload.html @@ -1,49 +1,57 @@ \ No newline at end of file diff --git a/force-app/main/default/lwc/fileUpload/fileUpload.js b/force-app/main/default/lwc/fileUpload/fileUpload.js index a4e9cc4..2d1f23f 100644 --- a/force-app/main/default/lwc/fileUpload/fileUpload.js +++ b/force-app/main/default/lwc/fileUpload/fileUpload.js @@ -1,13 +1,14 @@ -import { LightningElement, api, wire, track } from "lwc"; +import { LightningElement, api, track, wire } from "lwc"; +import { ShowToastEvent } from "lightning/platformShowToastEvent"; import { unstable_createContentDocumentAndVersion, createRecord, } from "lightning/uiRecordApi"; +// Imports for forced-prime ObjectInfo metadata work-around import { getObjectInfos } from "lightning/uiObjectInfoApi"; -import { ShowToastEvent } from "lightning/platformShowToastEvent"; -import CONTENT_DOCUMENT_LINK from "@salesforce/schema/ContentDocumentLink"; import CONTENT_DOCUMENT from "@salesforce/schema/ContentDocument"; import CONTENT_VERSION from "@salesforce/schema/ContentVersion"; +import CONTENT_DOCUMENT_LINK from "@salesforce/schema/ContentDocumentLink"; export default class FileUpload extends LightningElement { @api @@ -28,13 +29,16 @@ export default class FileUpload extends LightningElement { @track errorMessage = ""; - // Object metadata are required for creating records in offline. The wire adapter is added here to ensure the content metadata are primed. + // Object metadata, or "ObjectInfo", is required for creating records + // while offline. Use the getObjectInfos adapter to "force-prime" the + // necessary object metadata. This is a work-around for the static analyzer + // not knowing enough about the file object schema. @wire(getObjectInfos, { - objectApiNames: [CONTENT_DOCUMENT_LINK, CONTENT_DOCUMENT, CONTENT_VERSION], + objectApiNames: [CONTENT_DOCUMENT, CONTENT_VERSION, CONTENT_DOCUMENT_LINK], }) objectMetadata; - // This getter is only used for local processing. It does not need to be enabled for offline caching. + // Getter used for local-only processing. Not needed for offline caching. // eslint-disable-next-line @salesforce/lwc-graph-analyzer/no-getter-contains-more-than-return-statement get fileName() { // eslint-disable-next-line @salesforce/lwc-graph-analyzer/no-unsupported-member-variable-in-member-expression @@ -45,7 +49,8 @@ export default class FileUpload extends LightningElement { return undefined; } - handleInputChange(event) { + // Input handlers + handleFilesInputChange(event) { this.files = event.detail.files; this.titleValue = this.fileName; } @@ -58,7 +63,7 @@ export default class FileUpload extends LightningElement { this.descriptionValue = event.detail.value; } - // Restore the UI to its default state to allow uploading + // Restore UI to default state resetInputs() { this.files = []; this.titleValue = ""; @@ -66,7 +71,7 @@ export default class FileUpload extends LightningElement { this.errorMessage = ""; } - // Handle the user uploading a file + // Handle uploading a file, initiated by user clicking Upload button async handleUploadClick() { if (this.uploadingFile) { return; @@ -80,8 +85,8 @@ export default class FileUpload extends LightningElement { try { this.uploadingFile = true; - // Create a Content Document and Version for the file - // effectively uploading it + // Create a ContentDocument and related ContentDocumentVersion for + // the file, effectively uploading it const contentDocumentAndVersion = await unstable_createContentDocumentAndVersion({ title: this.titleValue, @@ -89,13 +94,21 @@ export default class FileUpload extends LightningElement { fileData: file, }); + // If component is run in a record context (recordId is set), relate + // the uploaded file to that record if (this.recordId) { const contentDocumentId = contentDocumentAndVersion.contentDocument.id; // Create a ContentDocumentLink (CDL) to associate the uploaded file - // to the Files Related List of the target recordId - await this.createCdl(this.recordId, contentDocumentId); + // to the Files related list of the target recordId + await this.createContentDocumentLink(this.recordId, contentDocumentId); } + + // Status and state updates + console.log( + "ContentDocument and ContentDocumentVersion records created." + ); + this.notifySuccess(); this.resetInputs(); } catch (error) { console.error(error); @@ -105,8 +118,8 @@ export default class FileUpload extends LightningElement { } } - // Create the link between the new file upload and the target record - async createCdl(recordId, contentDocumentId) { + // Create link between new file upload and target record + async createContentDocumentLink(recordId, contentDocumentId) { await createRecord({ apiName: "ContentDocumentLink", fields: { @@ -115,12 +128,16 @@ export default class FileUpload extends LightningElement { ShareType: "V", }, }); + console.log("ContentDocumentLink record created."); + } + + notifySuccess() { this.dispatchEvent( new ShowToastEvent({ - title: "Success", - message: "File attached", + title: "Upload Successful", + message: "File enqueued for upload.", variant: "success", - }), + }) ); } } diff --git a/force-app/main/default/lwc/fileUpload/fileUpload.js-meta.xml b/force-app/main/default/lwc/fileUpload/fileUpload.js-meta.xml index a8bebd0..d7d90af 100644 --- a/force-app/main/default/lwc/fileUpload/fileUpload.js-meta.xml +++ b/force-app/main/default/lwc/fileUpload/fileUpload.js-meta.xml @@ -1,6 +1,7 @@ - + - 57.0 + Example of offline-capable file uploads. + 58.0 true lightning__RecordPage @@ -10,5 +11,10 @@ ScreenAction + + + + + \ No newline at end of file From 0689dc28e11764923fffcc3e49bcf7ef4c2a25da Mon Sep 17 00:00:00 2001 From: Michael Alderete Date: Mon, 20 Nov 2023 10:38:37 -0800 Subject: [PATCH 2/6] Rearrange logging, add a couple comments --- force-app/main/default/lwc/fileUpload/fileUpload.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/force-app/main/default/lwc/fileUpload/fileUpload.js b/force-app/main/default/lwc/fileUpload/fileUpload.js index 2d1f23f..b941b95 100644 --- a/force-app/main/default/lwc/fileUpload/fileUpload.js +++ b/force-app/main/default/lwc/fileUpload/fileUpload.js @@ -73,10 +73,12 @@ export default class FileUpload extends LightningElement { // Handle uploading a file, initiated by user clicking Upload button async handleUploadClick() { + // Make sure we're not already uploading something if (this.uploadingFile) { return; } + // Make sure we have something to upload const file = this.files && this.files[0]; if (!file) { return; @@ -93,6 +95,7 @@ export default class FileUpload extends LightningElement { description: this.descriptionValue, fileData: file, }); + console.log("ContentDocument and ContentDocumentVersion records created."); // If component is run in a record context (recordId is set), relate // the uploaded file to that record @@ -105,9 +108,7 @@ export default class FileUpload extends LightningElement { } // Status and state updates - console.log( - "ContentDocument and ContentDocumentVersion records created." - ); + console.log("File upload created and enqueued."); this.notifySuccess(); this.resetInputs(); } catch (error) { From 04eb98e39c63fd2a3617e54b66a7213b1c718175 Mon Sep 17 00:00:00 2001 From: Michael Alderete Date: Tue, 21 Nov 2023 13:06:19 -0800 Subject: [PATCH 3/6] Update tests, run prettier This is an attempt to resolve the CI errors in GitHub. --- .../main/default/lwc/fileUpload/__tests__/fileUpload.test.js | 2 +- force-app/main/default/lwc/fileUpload/fileUpload.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/lwc/fileUpload/__tests__/fileUpload.test.js b/force-app/main/default/lwc/fileUpload/__tests__/fileUpload.test.js index 3590822..c646e5d 100644 --- a/force-app/main/default/lwc/fileUpload/__tests__/fileUpload.test.js +++ b/force-app/main/default/lwc/fileUpload/__tests__/fileUpload.test.js @@ -21,7 +21,7 @@ describe("c-file-upload", () => { // test // verify select files button is shown const selectButton = element.shadowRoot.querySelector("lightning-input"); - expect(selectButton.label).toBe("Pick file to upload"); + expect(selectButton.label).toBe("Select file to upload"); // verify upload button is not shown const uploadButton = element.shadowRoot.querySelector("button.slds-button"); expect(uploadButton).toBeNull(); diff --git a/force-app/main/default/lwc/fileUpload/fileUpload.js b/force-app/main/default/lwc/fileUpload/fileUpload.js index b941b95..aac2102 100644 --- a/force-app/main/default/lwc/fileUpload/fileUpload.js +++ b/force-app/main/default/lwc/fileUpload/fileUpload.js @@ -95,7 +95,9 @@ export default class FileUpload extends LightningElement { description: this.descriptionValue, fileData: file, }); - console.log("ContentDocument and ContentDocumentVersion records created."); + console.log( + "ContentDocument and ContentDocumentVersion records created." + ); // If component is run in a record context (recordId is set), relate // the uploaded file to that record From c8706713cb3d68435893ac1e57d413aa556be37a Mon Sep 17 00:00:00 2001 From: Michael Alderete Date: Tue, 21 Nov 2023 13:08:50 -0800 Subject: [PATCH 4/6] Run prettier on OTHER PEOPLE'S CODE Yikes... --- .../accountRelatedContacts.js | 2 +- .../__tests__/createAccountRecord.test.js | 8 ++++---- .../__tests__/createContactRecord.test.js | 10 +++++----- .../__tests__/createOpportunityRecord.test.js | 8 ++++---- .../__tests__/createVisitRecord.test.js | 8 ++++---- .../__tests__/editAccountRecord.test.js | 10 +++++----- .../__tests__/editVisitRecord.test.js | 10 +++++----- .../__tests__/locationService.test.js | 16 ++++++++-------- .../recordHeader/__tests__/recordHeader.test.js | 8 ++++---- .../scanBarcode/__tests__/scanBarcode.test.js | 10 +++++----- .../lwc/scanBarcodeLookup/scanBarcodeLookup.js | 8 ++++---- .../__tests__/viewAccountsWithApex.test.js | 2 +- 12 files changed, 50 insertions(+), 50 deletions(-) diff --git a/force-app/main/default/lwc/accountRelatedContacts/accountRelatedContacts.js b/force-app/main/default/lwc/accountRelatedContacts/accountRelatedContacts.js index 406c981..25ceb73 100644 --- a/force-app/main/default/lwc/accountRelatedContacts/accountRelatedContacts.js +++ b/force-app/main/default/lwc/accountRelatedContacts/accountRelatedContacts.js @@ -5,7 +5,7 @@ import { graphql, gql } from "lightning/uiGraphQLApi"; // eslint-disable-next-line @salesforce/lwc-graph-analyzer/no-unresolved-parent-class-reference export default class AccountRelatedContacts extends NavigationMixin( - LightningElement, + LightningElement ) { @api recordId; diff --git a/force-app/main/default/lwc/createAccountRecord/__tests__/createAccountRecord.test.js b/force-app/main/default/lwc/createAccountRecord/__tests__/createAccountRecord.test.js index 9b815c1..ed5dec1 100644 --- a/force-app/main/default/lwc/createAccountRecord/__tests__/createAccountRecord.test.js +++ b/force-app/main/default/lwc/createAccountRecord/__tests__/createAccountRecord.test.js @@ -28,7 +28,7 @@ describe("c-create-account-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); cancelButton.click(); @@ -58,12 +58,12 @@ describe("c-create-account-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]', + 'lightning-button[data-id="submit"]' ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); expect(cancelButton.type).toBe("button"); @@ -72,7 +72,7 @@ describe("c-create-account-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field"), + element.shadowRoot.querySelectorAll("lightning-input-field") ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); }); diff --git a/force-app/main/default/lwc/createContactRecord/__tests__/createContactRecord.test.js b/force-app/main/default/lwc/createContactRecord/__tests__/createContactRecord.test.js index f4255c7..4245af5 100644 --- a/force-app/main/default/lwc/createContactRecord/__tests__/createContactRecord.test.js +++ b/force-app/main/default/lwc/createContactRecord/__tests__/createContactRecord.test.js @@ -29,7 +29,7 @@ describe("c-create-contact-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); cancelButton.click(); @@ -61,12 +61,12 @@ describe("c-create-contact-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]', + 'lightning-button[data-id="submit"]' ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); expect(cancelButton.type).toBe("button"); @@ -75,13 +75,13 @@ describe("c-create-contact-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field"), + element.shadowRoot.querySelectorAll("lightning-input-field") ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); // get the lightning-record-picker and ensure objectApiName is Account const pickerFieldName = Array.from( - element.shadowRoot.querySelectorAll("lightning-record-picker"), + element.shadowRoot.querySelectorAll("lightning-record-picker") ) .map((outputField) => outputField.objectApiName) .shift(); diff --git a/force-app/main/default/lwc/createOpportunityRecord/__tests__/createOpportunityRecord.test.js b/force-app/main/default/lwc/createOpportunityRecord/__tests__/createOpportunityRecord.test.js index e31558c..c863a4e 100644 --- a/force-app/main/default/lwc/createOpportunityRecord/__tests__/createOpportunityRecord.test.js +++ b/force-app/main/default/lwc/createOpportunityRecord/__tests__/createOpportunityRecord.test.js @@ -29,7 +29,7 @@ describe("c-create-opportunity-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); cancelButton.click(); @@ -60,12 +60,12 @@ describe("c-create-opportunity-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]', + 'lightning-button[data-id="submit"]' ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); expect(cancelButton.type).toBe("button"); @@ -74,7 +74,7 @@ describe("c-create-opportunity-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field"), + element.shadowRoot.querySelectorAll("lightning-input-field") ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); }); diff --git a/force-app/main/default/lwc/createVisitRecord/__tests__/createVisitRecord.test.js b/force-app/main/default/lwc/createVisitRecord/__tests__/createVisitRecord.test.js index 25c5e8b..0742096 100644 --- a/force-app/main/default/lwc/createVisitRecord/__tests__/createVisitRecord.test.js +++ b/force-app/main/default/lwc/createVisitRecord/__tests__/createVisitRecord.test.js @@ -29,7 +29,7 @@ describe("c-create-visit-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); cancelButton.click(); @@ -60,12 +60,12 @@ describe("c-create-visit-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]', + 'lightning-button[data-id="submit"]' ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); expect(cancelButton.type).toBe("button"); @@ -74,7 +74,7 @@ describe("c-create-visit-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field"), + element.shadowRoot.querySelectorAll("lightning-input-field") ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); }); diff --git a/force-app/main/default/lwc/editAccountRecord/__tests__/editAccountRecord.test.js b/force-app/main/default/lwc/editAccountRecord/__tests__/editAccountRecord.test.js index 79c1348..6ee2132 100644 --- a/force-app/main/default/lwc/editAccountRecord/__tests__/editAccountRecord.test.js +++ b/force-app/main/default/lwc/editAccountRecord/__tests__/editAccountRecord.test.js @@ -49,12 +49,12 @@ describe("c-edit-account-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]', + 'lightning-button[data-id="submit"]' ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); expect(cancelButton.type).toBe("button"); @@ -63,7 +63,7 @@ describe("c-edit-account-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field"), + element.shadowRoot.querySelectorAll("lightning-input-field") ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); @@ -71,7 +71,7 @@ describe("c-edit-account-record", () => { // that is built after the @wire executes. return Promise.resolve().then(() => { const displayName = element.shadowRoot.querySelector( - 'lightning-layout-item[data-id="name"]', + 'lightning-layout-item[data-id="name"]' ); const mockedName = mockRecord.fields.Name.value; @@ -91,7 +91,7 @@ describe("c-edit-account-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); cancelButton.click(); diff --git a/force-app/main/default/lwc/editVisitRecord/__tests__/editVisitRecord.test.js b/force-app/main/default/lwc/editVisitRecord/__tests__/editVisitRecord.test.js index 602d736..9c7ca1e 100644 --- a/force-app/main/default/lwc/editVisitRecord/__tests__/editVisitRecord.test.js +++ b/force-app/main/default/lwc/editVisitRecord/__tests__/editVisitRecord.test.js @@ -51,12 +51,12 @@ describe("c-edit-visit-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]', + 'lightning-button[data-id="submit"]' ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); expect(cancelButton.type).toBe("button"); @@ -65,7 +65,7 @@ describe("c-edit-visit-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field"), + element.shadowRoot.querySelectorAll("lightning-input-field") ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); @@ -73,7 +73,7 @@ describe("c-edit-visit-record", () => { // that is built after the @wire executes. return Promise.resolve().then(() => { const displayName = element.shadowRoot.querySelector( - 'lightning-layout-item[data-id="name"]', + 'lightning-layout-item[data-id="name"]' ); const mockedName = mockRecord.fields.Name.value; @@ -93,7 +93,7 @@ describe("c-edit-visit-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]', + 'lightning-button[data-id="cancel"]' ); cancelButton.click(); diff --git a/force-app/main/default/lwc/locationService/__tests__/locationService.test.js b/force-app/main/default/lwc/locationService/__tests__/locationService.test.js index b5eb31a..7ecbd98 100644 --- a/force-app/main/default/lwc/locationService/__tests__/locationService.test.js +++ b/force-app/main/default/lwc/locationService/__tests__/locationService.test.js @@ -33,10 +33,10 @@ describe("c-location-service", () => { // check to ensure the template was updated with the expected latitude and longitude const currentLatitude = element.shadowRoot.querySelector( - 'slot[name="latitude"]', + 'slot[name="latitude"]' ); const currentLongitude = element.shadowRoot.querySelector( - 'slot[name="longitude"]', + 'slot[name="longitude"]' ); // eslint-disable-next-line @lwc/lwc/no-inner-html @@ -50,7 +50,7 @@ describe("c-location-service", () => { // setup let mockLocationService = getLocationService(); mockLocationService.getCurrentPosition = jest.fn(() => - Promise.reject({ code: "some-error", message: "some error occured!" }), + Promise.reject({ code: "some-error", message: "some error occured!" }) ); const element = createElement("c-location-service", { is: LocationService, @@ -69,13 +69,13 @@ describe("c-location-service", () => { // check to ensure the template was updated with the error code const errorMessage = element.shadowRoot.querySelector( - 'span[data-id="error"]', + 'span[data-id="error"]' ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(errorMessage.innerHTML).toBe("some error occured!"); const fetchedPosition = element.shadowRoot.querySelector( - 'span[data-id="result"]', + 'span[data-id="result"]' ); expect(fetchedPosition).toBe(null); // should not even be visible in the dom }); @@ -103,15 +103,15 @@ describe("c-location-service", () => { // check to ensure the template was updated with the error code const errorMessage = element.shadowRoot.querySelector( - 'span[data-id="error"]', + 'span[data-id="error"]' ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(errorMessage.innerHTML).toBe( - "Nimbus location service is not available.", + "Nimbus location service is not available." ); const fetchedPosition = element.shadowRoot.querySelector( - 'span[data-id="result"]', + 'span[data-id="result"]' ); expect(fetchedPosition).toBe(null); // should not even be visible in the dom }); diff --git a/force-app/main/default/lwc/recordHeader/__tests__/recordHeader.test.js b/force-app/main/default/lwc/recordHeader/__tests__/recordHeader.test.js index f3b5439..a3c860c 100644 --- a/force-app/main/default/lwc/recordHeader/__tests__/recordHeader.test.js +++ b/force-app/main/default/lwc/recordHeader/__tests__/recordHeader.test.js @@ -21,19 +21,19 @@ describe("c-record-header", () => { // Resolve a promise to wait for a re-render of the new content await Promise.resolve(); const iconField = element.shadowRoot.querySelector( - 'lightning-icon[data-id="iconId"]', + 'lightning-icon[data-id="iconId"]' ); expect(iconField.iconName).toBe( - "standard:" + element.objectApiName.toLowerCase(), + "standard:" + element.objectApiName.toLowerCase() ); const nameField = element.shadowRoot.querySelector( - 'lightning-layout-item[data-id="nameId"]', + 'lightning-layout-item[data-id="nameId"]' ); expect(nameField.textContent).toBe(element.recordName); const objectField = element.shadowRoot.querySelector( - 'lightning-layout-item[data-id="objectApiNameId"]', + 'lightning-layout-item[data-id="objectApiNameId"]' ); expect(objectField.textContent).toBe(element.objectApiName); }); diff --git a/force-app/main/default/lwc/scanBarcode/__tests__/scanBarcode.test.js b/force-app/main/default/lwc/scanBarcode/__tests__/scanBarcode.test.js index 6a12212..1a0f908 100644 --- a/force-app/main/default/lwc/scanBarcode/__tests__/scanBarcode.test.js +++ b/force-app/main/default/lwc/scanBarcode/__tests__/scanBarcode.test.js @@ -32,7 +32,7 @@ describe("c-scan-barcode", () => { // check to ensure the template was updated with the scanned barcode const scannedBarcode = element.shadowRoot.querySelector( - 'span[data-id="result"]', + 'span[data-id="result"]' ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(scannedBarcode.innerHTML).toBe("some-barcode"); @@ -45,7 +45,7 @@ describe("c-scan-barcode", () => { // reset beginCapture() mock to return an error let mockBarcodeScanner = getBarcodeScanner(); mockBarcodeScanner.beginCapture = jest.fn(() => - Promise.reject({ code: "some-error", message: "some error occured!" }), + Promise.reject({ code: "some-error", message: "some error occured!" }) ); const element = createElement("c-scan-barcode", { @@ -64,7 +64,7 @@ describe("c-scan-barcode", () => { // check to ensure the template was updated with the error code const errorMessage = element.shadowRoot.querySelector( - 'span[data-id="error"]', + 'span[data-id="error"]' ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(errorMessage.innerHTML).toBe("some error occured!"); @@ -94,13 +94,13 @@ describe("c-scan-barcode", () => { // check to ensure the template was updated with the error code const errorMessage = element.shadowRoot.querySelector( - 'span[data-id="error"]', + 'span[data-id="error"]' ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(errorMessage.innerHTML).toBe("Scanner not initialized!"); const scannedBarcode = element.shadowRoot.querySelector( - 'span[data-id="result"]', + 'span[data-id="result"]' ); expect(scannedBarcode).toBe(null); // should not even be visible in the dom }); diff --git a/force-app/main/default/lwc/scanBarcodeLookup/scanBarcodeLookup.js b/force-app/main/default/lwc/scanBarcodeLookup/scanBarcodeLookup.js index 6f57468..98a99e8 100644 --- a/force-app/main/default/lwc/scanBarcodeLookup/scanBarcodeLookup.js +++ b/force-app/main/default/lwc/scanBarcodeLookup/scanBarcodeLookup.js @@ -88,7 +88,7 @@ export default class ScanBarcodeLookup extends LightningElement { title: "Successful Scan", message: "Barcode scanned successfully.", variant: "success", - }), + }) ); }) .catch((error) => { @@ -100,7 +100,7 @@ export default class ScanBarcodeLookup extends LightningElement { title: "Scanning Canceled", message: "Scanning canceled", mode: "sticky", - }), + }) ); } else { this.dispatchEvent( @@ -109,7 +109,7 @@ export default class ScanBarcodeLookup extends LightningElement { message: error.message, variant: "error", mode: "sticky", - }), + }) ); } }) @@ -126,7 +126,7 @@ export default class ScanBarcodeLookup extends LightningElement { title: "Barcode Scanner Is Not Available", message: "Failed to open barcode scanner", variant: "error", - }), + }) ); } } diff --git a/force-app/main/default/lwc/viewAccountsWithApex/__tests__/viewAccountsWithApex.test.js b/force-app/main/default/lwc/viewAccountsWithApex/__tests__/viewAccountsWithApex.test.js index 5fc6b5a..269654e 100644 --- a/force-app/main/default/lwc/viewAccountsWithApex/__tests__/viewAccountsWithApex.test.js +++ b/force-app/main/default/lwc/viewAccountsWithApex/__tests__/viewAccountsWithApex.test.js @@ -14,7 +14,7 @@ jest.mock( default: createApexTestWireAdapter(jest.fn()), }; }, - { virtual: true }, + { virtual: true } ); describe("c-view-accounts-with-apex", () => { From ba3c0c8a08987ede5a0b27113f834829b3c99f9f Mon Sep 17 00:00:00 2001 From: Michael Alderete Date: Tue, 21 Nov 2023 13:13:48 -0800 Subject: [PATCH 5/6] Revert "Run prettier on OTHER PEOPLE'S CODE" This reverts commit c8706713cb3d68435893ac1e57d413aa556be37a. --- .../accountRelatedContacts.js | 2 +- .../__tests__/createAccountRecord.test.js | 8 ++++---- .../__tests__/createContactRecord.test.js | 10 +++++----- .../__tests__/createOpportunityRecord.test.js | 8 ++++---- .../__tests__/createVisitRecord.test.js | 8 ++++---- .../__tests__/editAccountRecord.test.js | 10 +++++----- .../__tests__/editVisitRecord.test.js | 10 +++++----- .../__tests__/locationService.test.js | 16 ++++++++-------- .../recordHeader/__tests__/recordHeader.test.js | 8 ++++---- .../scanBarcode/__tests__/scanBarcode.test.js | 10 +++++----- .../lwc/scanBarcodeLookup/scanBarcodeLookup.js | 8 ++++---- .../__tests__/viewAccountsWithApex.test.js | 2 +- 12 files changed, 50 insertions(+), 50 deletions(-) diff --git a/force-app/main/default/lwc/accountRelatedContacts/accountRelatedContacts.js b/force-app/main/default/lwc/accountRelatedContacts/accountRelatedContacts.js index 25ceb73..406c981 100644 --- a/force-app/main/default/lwc/accountRelatedContacts/accountRelatedContacts.js +++ b/force-app/main/default/lwc/accountRelatedContacts/accountRelatedContacts.js @@ -5,7 +5,7 @@ import { graphql, gql } from "lightning/uiGraphQLApi"; // eslint-disable-next-line @salesforce/lwc-graph-analyzer/no-unresolved-parent-class-reference export default class AccountRelatedContacts extends NavigationMixin( - LightningElement + LightningElement, ) { @api recordId; diff --git a/force-app/main/default/lwc/createAccountRecord/__tests__/createAccountRecord.test.js b/force-app/main/default/lwc/createAccountRecord/__tests__/createAccountRecord.test.js index ed5dec1..9b815c1 100644 --- a/force-app/main/default/lwc/createAccountRecord/__tests__/createAccountRecord.test.js +++ b/force-app/main/default/lwc/createAccountRecord/__tests__/createAccountRecord.test.js @@ -28,7 +28,7 @@ describe("c-create-account-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); cancelButton.click(); @@ -58,12 +58,12 @@ describe("c-create-account-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]' + 'lightning-button[data-id="submit"]', ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); expect(cancelButton.type).toBe("button"); @@ -72,7 +72,7 @@ describe("c-create-account-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field") + element.shadowRoot.querySelectorAll("lightning-input-field"), ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); }); diff --git a/force-app/main/default/lwc/createContactRecord/__tests__/createContactRecord.test.js b/force-app/main/default/lwc/createContactRecord/__tests__/createContactRecord.test.js index 4245af5..f4255c7 100644 --- a/force-app/main/default/lwc/createContactRecord/__tests__/createContactRecord.test.js +++ b/force-app/main/default/lwc/createContactRecord/__tests__/createContactRecord.test.js @@ -29,7 +29,7 @@ describe("c-create-contact-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); cancelButton.click(); @@ -61,12 +61,12 @@ describe("c-create-contact-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]' + 'lightning-button[data-id="submit"]', ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); expect(cancelButton.type).toBe("button"); @@ -75,13 +75,13 @@ describe("c-create-contact-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field") + element.shadowRoot.querySelectorAll("lightning-input-field"), ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); // get the lightning-record-picker and ensure objectApiName is Account const pickerFieldName = Array.from( - element.shadowRoot.querySelectorAll("lightning-record-picker") + element.shadowRoot.querySelectorAll("lightning-record-picker"), ) .map((outputField) => outputField.objectApiName) .shift(); diff --git a/force-app/main/default/lwc/createOpportunityRecord/__tests__/createOpportunityRecord.test.js b/force-app/main/default/lwc/createOpportunityRecord/__tests__/createOpportunityRecord.test.js index c863a4e..e31558c 100644 --- a/force-app/main/default/lwc/createOpportunityRecord/__tests__/createOpportunityRecord.test.js +++ b/force-app/main/default/lwc/createOpportunityRecord/__tests__/createOpportunityRecord.test.js @@ -29,7 +29,7 @@ describe("c-create-opportunity-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); cancelButton.click(); @@ -60,12 +60,12 @@ describe("c-create-opportunity-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]' + 'lightning-button[data-id="submit"]', ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); expect(cancelButton.type).toBe("button"); @@ -74,7 +74,7 @@ describe("c-create-opportunity-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field") + element.shadowRoot.querySelectorAll("lightning-input-field"), ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); }); diff --git a/force-app/main/default/lwc/createVisitRecord/__tests__/createVisitRecord.test.js b/force-app/main/default/lwc/createVisitRecord/__tests__/createVisitRecord.test.js index 0742096..25c5e8b 100644 --- a/force-app/main/default/lwc/createVisitRecord/__tests__/createVisitRecord.test.js +++ b/force-app/main/default/lwc/createVisitRecord/__tests__/createVisitRecord.test.js @@ -29,7 +29,7 @@ describe("c-create-visit-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); cancelButton.click(); @@ -60,12 +60,12 @@ describe("c-create-visit-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]' + 'lightning-button[data-id="submit"]', ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); expect(cancelButton.type).toBe("button"); @@ -74,7 +74,7 @@ describe("c-create-visit-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field") + element.shadowRoot.querySelectorAll("lightning-input-field"), ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); }); diff --git a/force-app/main/default/lwc/editAccountRecord/__tests__/editAccountRecord.test.js b/force-app/main/default/lwc/editAccountRecord/__tests__/editAccountRecord.test.js index 6ee2132..79c1348 100644 --- a/force-app/main/default/lwc/editAccountRecord/__tests__/editAccountRecord.test.js +++ b/force-app/main/default/lwc/editAccountRecord/__tests__/editAccountRecord.test.js @@ -49,12 +49,12 @@ describe("c-edit-account-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]' + 'lightning-button[data-id="submit"]', ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); expect(cancelButton.type).toBe("button"); @@ -63,7 +63,7 @@ describe("c-edit-account-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field") + element.shadowRoot.querySelectorAll("lightning-input-field"), ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); @@ -71,7 +71,7 @@ describe("c-edit-account-record", () => { // that is built after the @wire executes. return Promise.resolve().then(() => { const displayName = element.shadowRoot.querySelector( - 'lightning-layout-item[data-id="name"]' + 'lightning-layout-item[data-id="name"]', ); const mockedName = mockRecord.fields.Name.value; @@ -91,7 +91,7 @@ describe("c-edit-account-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); cancelButton.click(); diff --git a/force-app/main/default/lwc/editVisitRecord/__tests__/editVisitRecord.test.js b/force-app/main/default/lwc/editVisitRecord/__tests__/editVisitRecord.test.js index 9c7ca1e..602d736 100644 --- a/force-app/main/default/lwc/editVisitRecord/__tests__/editVisitRecord.test.js +++ b/force-app/main/default/lwc/editVisitRecord/__tests__/editVisitRecord.test.js @@ -51,12 +51,12 @@ describe("c-edit-visit-record", () => { expect(form.objectApiName).toBe(OBJECT_API_NAME); const submitButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="submit"]' + 'lightning-button[data-id="submit"]', ); expect(submitButton.type).toBe("submit"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); expect(cancelButton.type).toBe("button"); @@ -65,7 +65,7 @@ describe("c-edit-visit-record", () => { // get the input fields and ensure they are in the correct order const outputFieldNames = Array.from( - element.shadowRoot.querySelectorAll("lightning-input-field") + element.shadowRoot.querySelectorAll("lightning-input-field"), ).map((outputField) => outputField.fieldName); expect(outputFieldNames).toEqual(INPUT_FIELDS); @@ -73,7 +73,7 @@ describe("c-edit-visit-record", () => { // that is built after the @wire executes. return Promise.resolve().then(() => { const displayName = element.shadowRoot.querySelector( - 'lightning-layout-item[data-id="name"]' + 'lightning-layout-item[data-id="name"]', ); const mockedName = mockRecord.fields.Name.value; @@ -93,7 +93,7 @@ describe("c-edit-visit-record", () => { const backSpy = jest.spyOn(window.history, "back"); const cancelButton = element.shadowRoot.querySelector( - 'lightning-button[data-id="cancel"]' + 'lightning-button[data-id="cancel"]', ); cancelButton.click(); diff --git a/force-app/main/default/lwc/locationService/__tests__/locationService.test.js b/force-app/main/default/lwc/locationService/__tests__/locationService.test.js index 7ecbd98..b5eb31a 100644 --- a/force-app/main/default/lwc/locationService/__tests__/locationService.test.js +++ b/force-app/main/default/lwc/locationService/__tests__/locationService.test.js @@ -33,10 +33,10 @@ describe("c-location-service", () => { // check to ensure the template was updated with the expected latitude and longitude const currentLatitude = element.shadowRoot.querySelector( - 'slot[name="latitude"]' + 'slot[name="latitude"]', ); const currentLongitude = element.shadowRoot.querySelector( - 'slot[name="longitude"]' + 'slot[name="longitude"]', ); // eslint-disable-next-line @lwc/lwc/no-inner-html @@ -50,7 +50,7 @@ describe("c-location-service", () => { // setup let mockLocationService = getLocationService(); mockLocationService.getCurrentPosition = jest.fn(() => - Promise.reject({ code: "some-error", message: "some error occured!" }) + Promise.reject({ code: "some-error", message: "some error occured!" }), ); const element = createElement("c-location-service", { is: LocationService, @@ -69,13 +69,13 @@ describe("c-location-service", () => { // check to ensure the template was updated with the error code const errorMessage = element.shadowRoot.querySelector( - 'span[data-id="error"]' + 'span[data-id="error"]', ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(errorMessage.innerHTML).toBe("some error occured!"); const fetchedPosition = element.shadowRoot.querySelector( - 'span[data-id="result"]' + 'span[data-id="result"]', ); expect(fetchedPosition).toBe(null); // should not even be visible in the dom }); @@ -103,15 +103,15 @@ describe("c-location-service", () => { // check to ensure the template was updated with the error code const errorMessage = element.shadowRoot.querySelector( - 'span[data-id="error"]' + 'span[data-id="error"]', ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(errorMessage.innerHTML).toBe( - "Nimbus location service is not available." + "Nimbus location service is not available.", ); const fetchedPosition = element.shadowRoot.querySelector( - 'span[data-id="result"]' + 'span[data-id="result"]', ); expect(fetchedPosition).toBe(null); // should not even be visible in the dom }); diff --git a/force-app/main/default/lwc/recordHeader/__tests__/recordHeader.test.js b/force-app/main/default/lwc/recordHeader/__tests__/recordHeader.test.js index a3c860c..f3b5439 100644 --- a/force-app/main/default/lwc/recordHeader/__tests__/recordHeader.test.js +++ b/force-app/main/default/lwc/recordHeader/__tests__/recordHeader.test.js @@ -21,19 +21,19 @@ describe("c-record-header", () => { // Resolve a promise to wait for a re-render of the new content await Promise.resolve(); const iconField = element.shadowRoot.querySelector( - 'lightning-icon[data-id="iconId"]' + 'lightning-icon[data-id="iconId"]', ); expect(iconField.iconName).toBe( - "standard:" + element.objectApiName.toLowerCase() + "standard:" + element.objectApiName.toLowerCase(), ); const nameField = element.shadowRoot.querySelector( - 'lightning-layout-item[data-id="nameId"]' + 'lightning-layout-item[data-id="nameId"]', ); expect(nameField.textContent).toBe(element.recordName); const objectField = element.shadowRoot.querySelector( - 'lightning-layout-item[data-id="objectApiNameId"]' + 'lightning-layout-item[data-id="objectApiNameId"]', ); expect(objectField.textContent).toBe(element.objectApiName); }); diff --git a/force-app/main/default/lwc/scanBarcode/__tests__/scanBarcode.test.js b/force-app/main/default/lwc/scanBarcode/__tests__/scanBarcode.test.js index 1a0f908..6a12212 100644 --- a/force-app/main/default/lwc/scanBarcode/__tests__/scanBarcode.test.js +++ b/force-app/main/default/lwc/scanBarcode/__tests__/scanBarcode.test.js @@ -32,7 +32,7 @@ describe("c-scan-barcode", () => { // check to ensure the template was updated with the scanned barcode const scannedBarcode = element.shadowRoot.querySelector( - 'span[data-id="result"]' + 'span[data-id="result"]', ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(scannedBarcode.innerHTML).toBe("some-barcode"); @@ -45,7 +45,7 @@ describe("c-scan-barcode", () => { // reset beginCapture() mock to return an error let mockBarcodeScanner = getBarcodeScanner(); mockBarcodeScanner.beginCapture = jest.fn(() => - Promise.reject({ code: "some-error", message: "some error occured!" }) + Promise.reject({ code: "some-error", message: "some error occured!" }), ); const element = createElement("c-scan-barcode", { @@ -64,7 +64,7 @@ describe("c-scan-barcode", () => { // check to ensure the template was updated with the error code const errorMessage = element.shadowRoot.querySelector( - 'span[data-id="error"]' + 'span[data-id="error"]', ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(errorMessage.innerHTML).toBe("some error occured!"); @@ -94,13 +94,13 @@ describe("c-scan-barcode", () => { // check to ensure the template was updated with the error code const errorMessage = element.shadowRoot.querySelector( - 'span[data-id="error"]' + 'span[data-id="error"]', ); // eslint-disable-next-line @lwc/lwc/no-inner-html expect(errorMessage.innerHTML).toBe("Scanner not initialized!"); const scannedBarcode = element.shadowRoot.querySelector( - 'span[data-id="result"]' + 'span[data-id="result"]', ); expect(scannedBarcode).toBe(null); // should not even be visible in the dom }); diff --git a/force-app/main/default/lwc/scanBarcodeLookup/scanBarcodeLookup.js b/force-app/main/default/lwc/scanBarcodeLookup/scanBarcodeLookup.js index 98a99e8..6f57468 100644 --- a/force-app/main/default/lwc/scanBarcodeLookup/scanBarcodeLookup.js +++ b/force-app/main/default/lwc/scanBarcodeLookup/scanBarcodeLookup.js @@ -88,7 +88,7 @@ export default class ScanBarcodeLookup extends LightningElement { title: "Successful Scan", message: "Barcode scanned successfully.", variant: "success", - }) + }), ); }) .catch((error) => { @@ -100,7 +100,7 @@ export default class ScanBarcodeLookup extends LightningElement { title: "Scanning Canceled", message: "Scanning canceled", mode: "sticky", - }) + }), ); } else { this.dispatchEvent( @@ -109,7 +109,7 @@ export default class ScanBarcodeLookup extends LightningElement { message: error.message, variant: "error", mode: "sticky", - }) + }), ); } }) @@ -126,7 +126,7 @@ export default class ScanBarcodeLookup extends LightningElement { title: "Barcode Scanner Is Not Available", message: "Failed to open barcode scanner", variant: "error", - }) + }), ); } } diff --git a/force-app/main/default/lwc/viewAccountsWithApex/__tests__/viewAccountsWithApex.test.js b/force-app/main/default/lwc/viewAccountsWithApex/__tests__/viewAccountsWithApex.test.js index 269654e..5fc6b5a 100644 --- a/force-app/main/default/lwc/viewAccountsWithApex/__tests__/viewAccountsWithApex.test.js +++ b/force-app/main/default/lwc/viewAccountsWithApex/__tests__/viewAccountsWithApex.test.js @@ -14,7 +14,7 @@ jest.mock( default: createApexTestWireAdapter(jest.fn()), }; }, - { virtual: true } + { virtual: true }, ); describe("c-view-accounts-with-apex", () => { From d982e3a2a5732073e8a7e2fb1e7b2423c34b5d99 Mon Sep 17 00:00:00 2001 From: Meisam Seyed Aliroteh Date: Mon, 1 Apr 2024 10:13:54 -0700 Subject: [PATCH 6/6] fix prettier error --- force-app/main/default/lwc/fileUpload/fileUpload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/lwc/fileUpload/fileUpload.js b/force-app/main/default/lwc/fileUpload/fileUpload.js index 9062c0a..1c9dd18 100644 --- a/force-app/main/default/lwc/fileUpload/fileUpload.js +++ b/force-app/main/default/lwc/fileUpload/fileUpload.js @@ -95,7 +95,7 @@ export default class FileUpload extends LightningElement { fileData: file, }); console.log( - "ContentDocument and ContentDocumentVersion records created." + "ContentDocument and ContentDocumentVersion records created.", ); // If component is run in a record context (recordId is set), relate @@ -139,7 +139,7 @@ export default class FileUpload extends LightningElement { title: "Upload Successful", message: "File enqueued for upload.", variant: "success", - }) + }), ); } }