Browse Source

chore(server): Better naming for mock FacetValue codes

Michael Bromley 7 years ago
parent
commit
7be192da35

+ 2 - 2
server/e2e/__snapshots__/product-category.e2e-spec.ts.snap

@@ -26,7 +26,7 @@ Object {
   "description": "",
   "facetValues": Array [
     Object {
-      "code": "Larkin_Group",
+      "code": "larkin-group",
       "id": "T_1",
       "name": "Larkin Group",
     },
@@ -75,7 +75,7 @@ Object {
   "description": "Apple stuff ",
   "facetValues": Array [
     Object {
-      "code": "Lindgren,_Conn_and_King",
+      "code": "lindgren-conn-and-king",
       "id": "T_3",
       "name": "Lindgren, Conn and King",
     },

+ 1 - 1
server/mock-data/mock-data.service.ts

@@ -435,7 +435,7 @@ export class MockDataService {
         return Array.from({ length: count }).map(() => {
             const brand = faker.company.companyName();
             return {
-                code: brand.replace(/\s/g, '_'),
+                code: brand.toLowerCase().replace(/[^a-zA-Z]+/g, '-'),
                 translations: [
                     {
                         languageCode: LanguageCode.en,