2021-09-27 10:04:21 +00:00
|
|
|
/// <reference types="cypress"/>
|
|
|
|
/// <reference types="../../support"/>
|
|
|
|
|
2021-07-23 09:46:44 +00:00
|
|
|
import faker from "faker";
|
|
|
|
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
import {
|
|
|
|
BUTTON_SELECTORS,
|
|
|
|
ORDER_GRANT_REFUND,
|
|
|
|
ORDERS_SELECTORS,
|
|
|
|
SHARED_ELEMENTS,
|
|
|
|
} from "../../elements/";
|
2023-05-23 11:51:56 +00:00
|
|
|
import { MESSAGES, ONE_PERMISSION_USERS, urlList } from "../../fixtures";
|
2021-09-27 10:04:21 +00:00
|
|
|
import {
|
|
|
|
createCustomer,
|
2022-06-27 16:49:35 +00:00
|
|
|
deleteCustomersStartsWith,
|
2021-09-27 10:04:21 +00:00
|
|
|
getOrder,
|
2023-05-23 11:51:56 +00:00
|
|
|
updateMetadata,
|
2022-06-27 16:49:35 +00:00
|
|
|
updateOrdersSettings,
|
2023-05-23 11:51:56 +00:00
|
|
|
updatePrivateMetadata,
|
|
|
|
} from "../../support/api/requests/";
|
2021-07-23 09:46:44 +00:00
|
|
|
import {
|
|
|
|
createFulfilledOrder,
|
|
|
|
createOrder,
|
2022-06-27 16:49:35 +00:00
|
|
|
createReadyToFulfillOrder,
|
2021-07-23 09:46:44 +00:00
|
|
|
createShipping,
|
2023-05-23 11:51:56 +00:00
|
|
|
createUnconfirmedOrder,
|
2022-06-27 16:49:35 +00:00
|
|
|
deleteShippingStartsWith,
|
2023-05-23 11:51:56 +00:00
|
|
|
getDefaultChannel,
|
2023-01-09 09:55:12 +00:00
|
|
|
getDefaultTaxClass,
|
2023-05-23 11:51:56 +00:00
|
|
|
productsUtils,
|
2023-01-09 09:55:12 +00:00
|
|
|
updateTaxConfigurationForChannel,
|
2023-05-23 11:51:56 +00:00
|
|
|
} from "../../support/api/utils/";
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
import {
|
|
|
|
addNewProductToOrder,
|
2023-05-23 11:51:56 +00:00
|
|
|
addPrivateMetadataFieldFulfillmentOrder,
|
|
|
|
addPublicMetadataFieldFulfillmentOrder,
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
applyFixedLineDiscountForProduct,
|
|
|
|
changeQuantityOfProducts,
|
2023-05-23 11:51:56 +00:00
|
|
|
deletePrivateFulfillmentMetadata,
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
deleteProductFromGridTableOnIndex,
|
2023-05-23 11:51:56 +00:00
|
|
|
deletePublicFulfillmentMetadata,
|
|
|
|
expandPrivateFulfillmentMetadata,
|
|
|
|
expandPublicFulfillmentMetadata,
|
|
|
|
finalizeDraftOrder,
|
|
|
|
selectChannelInPicker,
|
|
|
|
updatePrivateMetadataFieldFulfillmentOrder,
|
|
|
|
updatePublicMetadataFieldFulfillmentOrder,
|
|
|
|
} from "../../support/pages/";
|
2021-07-23 09:46:44 +00:00
|
|
|
|
2022-06-27 09:30:51 +00:00
|
|
|
describe("Orders", () => {
|
|
|
|
const startsWith = "CyOrders-";
|
|
|
|
const randomName = startsWith + faker.datatype.number();
|
2021-07-23 09:46:44 +00:00
|
|
|
|
2022-06-27 09:30:51 +00:00
|
|
|
let customer;
|
|
|
|
let defaultChannel;
|
|
|
|
let warehouse;
|
|
|
|
let shippingMethod;
|
|
|
|
let variantsList;
|
|
|
|
let address;
|
2023-01-09 09:55:12 +00:00
|
|
|
let taxClass;
|
2021-07-23 09:46:44 +00:00
|
|
|
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
const shippingPrice = 2;
|
|
|
|
const variantPrice = 1;
|
2023-05-23 11:51:56 +00:00
|
|
|
const metadataName = randomName + "- metadata name";
|
|
|
|
const metadataValue = randomName + "- metadata value";
|
|
|
|
const privateMetadataName = randomName + "- private metadata name";
|
|
|
|
const privateMetadataValue = randomName + "- private metadata value";
|
|
|
|
const updatedMetadataName = metadataName + "- updated metadata name";
|
|
|
|
const updatedMetadataValue = metadataValue + "- updated metadata value";
|
|
|
|
const updatedPrivateMetadataName =
|
|
|
|
privateMetadataName + "- updated private metadata name";
|
|
|
|
const updatedPrivateMetadataValue =
|
|
|
|
privateMetadataValue + "- updated private metadata value";
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
|
2022-06-27 09:30:51 +00:00
|
|
|
before(() => {
|
|
|
|
cy.clearSessionData().loginUserViaRequest();
|
|
|
|
deleteCustomersStartsWith(startsWith);
|
|
|
|
deleteShippingStartsWith(startsWith);
|
|
|
|
productsUtils.deleteProductsStartsWith(startsWith);
|
2021-07-23 09:46:44 +00:00
|
|
|
|
2022-06-27 09:30:51 +00:00
|
|
|
updateOrdersSettings();
|
|
|
|
getDefaultChannel()
|
|
|
|
.then(channel => {
|
|
|
|
defaultChannel = channel;
|
2023-01-09 09:55:12 +00:00
|
|
|
updateTaxConfigurationForChannel({ channelSlug: defaultChannel.slug });
|
|
|
|
getDefaultTaxClass();
|
2022-06-27 09:30:51 +00:00
|
|
|
})
|
2023-01-09 09:55:12 +00:00
|
|
|
.then(resp => {
|
|
|
|
taxClass = resp;
|
2022-06-27 09:30:51 +00:00
|
|
|
cy.fixture("addresses");
|
|
|
|
})
|
|
|
|
.then(addresses => {
|
|
|
|
address = addresses.plAddress;
|
|
|
|
createCustomer(`${randomName}@example.com`, randomName, address, true);
|
|
|
|
})
|
|
|
|
.then(customerResp => {
|
|
|
|
customer = customerResp.user;
|
|
|
|
createShipping({
|
|
|
|
channelId: defaultChannel.id,
|
|
|
|
name: randomName,
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
price: shippingPrice,
|
2022-06-27 16:49:35 +00:00
|
|
|
address,
|
2023-01-09 09:55:12 +00:00
|
|
|
taxClassId: taxClass.id,
|
2022-06-27 09:30:51 +00:00
|
|
|
});
|
|
|
|
})
|
|
|
|
.then(
|
|
|
|
({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => {
|
|
|
|
shippingMethod = shippingMethodResp;
|
|
|
|
warehouse = warehouseResp;
|
|
|
|
productsUtils.createTypeAttributeAndCategoryForProduct({
|
2022-06-27 16:49:35 +00:00
|
|
|
name: randomName,
|
2022-06-27 09:30:51 +00:00
|
|
|
});
|
2022-06-27 16:49:35 +00:00
|
|
|
},
|
2022-06-27 09:30:51 +00:00
|
|
|
)
|
|
|
|
.then(
|
|
|
|
({
|
|
|
|
productType: productTypeResp,
|
|
|
|
attribute: attributeResp,
|
2022-06-27 16:49:35 +00:00
|
|
|
category: categoryResp,
|
2022-06-27 09:30:51 +00:00
|
|
|
}) => {
|
|
|
|
productsUtils.createProductInChannel({
|
2021-07-23 09:46:44 +00:00
|
|
|
name: randomName,
|
2022-06-27 09:30:51 +00:00
|
|
|
channelId: defaultChannel.id,
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
price: variantPrice,
|
2022-06-27 09:30:51 +00:00
|
|
|
warehouseId: warehouse.id,
|
|
|
|
productTypeId: productTypeResp.id,
|
|
|
|
attributeId: attributeResp.id,
|
2022-06-27 16:49:35 +00:00
|
|
|
categoryId: categoryResp.id,
|
2023-01-09 09:55:12 +00:00
|
|
|
taxClassId: taxClass.id,
|
2021-07-23 09:46:44 +00:00
|
|
|
});
|
2022-06-27 16:49:35 +00:00
|
|
|
},
|
2022-06-27 09:30:51 +00:00
|
|
|
)
|
|
|
|
.then(({ variantsList: variantsResp }) => {
|
|
|
|
variantsList = variantsResp;
|
2023-01-16 13:55:38 +00:00
|
|
|
cy.checkIfDataAreNotNull({
|
|
|
|
customer,
|
|
|
|
defaultChannel,
|
|
|
|
warehouse,
|
|
|
|
shippingMethod,
|
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
});
|
2022-06-27 09:30:51 +00:00
|
|
|
});
|
|
|
|
});
|
2021-07-23 09:46:44 +00:00
|
|
|
|
2022-06-27 09:30:51 +00:00
|
|
|
beforeEach(() => {
|
|
|
|
cy.clearSessionData().loginUserViaRequest(
|
|
|
|
"auth",
|
2022-06-27 16:49:35 +00:00
|
|
|
ONE_PERMISSION_USERS.order,
|
2022-06-27 09:30:51 +00:00
|
|
|
);
|
|
|
|
});
|
2021-07-23 09:46:44 +00:00
|
|
|
|
2022-08-04 10:59:42 +00:00
|
|
|
it(
|
2022-07-18 11:00:24 +00:00
|
|
|
"should create order with selected channel. TC: SALEOR_2104",
|
2022-10-25 17:27:26 +00:00
|
|
|
{ tags: ["@orders", "@allEnv", "@stable", "@oldRelease"] },
|
2022-06-27 09:30:51 +00:00
|
|
|
() => {
|
2023-03-09 08:18:07 +00:00
|
|
|
cy.visit(urlList.orders).get(ORDERS_SELECTORS.createOrderButton).click();
|
2021-07-23 09:46:44 +00:00
|
|
|
selectChannelInPicker(defaultChannel.name);
|
2023-02-22 13:07:48 +00:00
|
|
|
finalizeDraftOrder(randomName, address);
|
2022-06-27 16:49:35 +00:00
|
|
|
},
|
2022-06-27 09:30:51 +00:00
|
|
|
);
|
2021-07-23 09:46:44 +00:00
|
|
|
|
2022-06-27 09:30:51 +00:00
|
|
|
it(
|
2022-07-18 11:00:24 +00:00
|
|
|
"should not be possible to change channel in order. TC: SALEOR_2105",
|
2022-10-25 17:27:26 +00:00
|
|
|
{ tags: ["@orders", "@allEnv", "@stable", "@oldRelease"] },
|
2022-06-27 09:30:51 +00:00
|
|
|
() => {
|
2021-07-23 09:46:44 +00:00
|
|
|
createOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
2022-10-25 11:44:10 +00:00
|
|
|
shippingMethod,
|
2021-07-23 09:46:44 +00:00
|
|
|
variantsList,
|
2022-06-27 16:49:35 +00:00
|
|
|
address,
|
2021-07-23 09:46:44 +00:00
|
|
|
}).then(order => {
|
2023-04-21 11:34:56 +00:00
|
|
|
cy.visit(urlList.orders + `${order.id}`);
|
2021-07-23 09:46:44 +00:00
|
|
|
cy.get(ORDERS_SELECTORS.salesChannel)
|
|
|
|
.find("[button]")
|
|
|
|
.should("not.exist");
|
|
|
|
});
|
2022-06-27 16:49:35 +00:00
|
|
|
},
|
2022-06-27 09:30:51 +00:00
|
|
|
);
|
2021-07-23 09:46:44 +00:00
|
|
|
|
2022-07-18 11:00:24 +00:00
|
|
|
it(
|
|
|
|
"should cancel fulfillment. TC: SALEOR_2106",
|
2022-10-25 17:27:26 +00:00
|
|
|
{ tags: ["@orders", "@allEnv", "@stable", "@oldRelease"] },
|
2022-07-18 11:00:24 +00:00
|
|
|
() => {
|
|
|
|
let order;
|
|
|
|
createFulfilledOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
2022-10-25 11:44:10 +00:00
|
|
|
shippingMethod,
|
2022-07-18 11:00:24 +00:00
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
warehouse: warehouse.id,
|
2021-07-23 09:46:44 +00:00
|
|
|
})
|
2022-07-18 11:00:24 +00:00
|
|
|
.then(({ order: orderResp }) => {
|
|
|
|
order = orderResp;
|
2023-04-21 11:34:56 +00:00
|
|
|
cy.visit(urlList.orders + `${order.id}`);
|
2022-07-18 11:00:24 +00:00
|
|
|
cy.get(SHARED_ELEMENTS.skeleton)
|
|
|
|
.should("not.exist")
|
|
|
|
.get(ORDERS_SELECTORS.cancelFulfillment)
|
|
|
|
.click()
|
|
|
|
.get(ORDERS_SELECTORS.cancelFulfillmentSelectField)
|
|
|
|
.click()
|
|
|
|
.get(BUTTON_SELECTORS.selectOption)
|
|
|
|
.first()
|
|
|
|
.click()
|
|
|
|
.addAliasToGraphRequest("OrderFulfillmentCancel")
|
|
|
|
.get(BUTTON_SELECTORS.submit)
|
|
|
|
.click()
|
|
|
|
.waitForRequestAndCheckIfNoErrors("@OrderFulfillmentCancel");
|
|
|
|
getOrder(order.id);
|
|
|
|
})
|
|
|
|
.then(orderResp => {
|
|
|
|
expect(orderResp.status).to.be.eq("UNFULFILLED");
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
2021-07-23 09:46:44 +00:00
|
|
|
|
2022-06-27 09:30:51 +00:00
|
|
|
it(
|
2022-07-18 11:00:24 +00:00
|
|
|
"should make a refund. TC: 2107",
|
2022-10-25 17:27:26 +00:00
|
|
|
{ tags: ["@orders", "@allEnv", "@stable", "@oldRelease"] },
|
2022-06-27 09:30:51 +00:00
|
|
|
() => {
|
2021-07-23 09:46:44 +00:00
|
|
|
let order;
|
|
|
|
createReadyToFulfillOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
2022-10-25 11:44:10 +00:00
|
|
|
shippingMethod,
|
2021-07-23 09:46:44 +00:00
|
|
|
variantsList,
|
2022-06-27 16:49:35 +00:00
|
|
|
address,
|
2021-07-23 09:46:44 +00:00
|
|
|
})
|
|
|
|
.then(({ order: orderResp }) => {
|
|
|
|
order = orderResp;
|
2023-04-21 11:34:56 +00:00
|
|
|
cy.visit(urlList.orders + `${order.id}`);
|
2021-07-23 09:46:44 +00:00
|
|
|
cy.get(ORDERS_SELECTORS.refundButton)
|
|
|
|
.click()
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
.get(ORDER_GRANT_REFUND.productsQuantityInput)
|
2021-07-23 09:46:44 +00:00
|
|
|
.type("1")
|
|
|
|
.addAliasToGraphRequest("OrderFulfillmentRefundProducts");
|
|
|
|
cy.get(BUTTON_SELECTORS.submit)
|
|
|
|
.click()
|
2021-09-27 10:04:21 +00:00
|
|
|
.waitForRequestAndCheckIfNoErrors(
|
2022-06-27 16:49:35 +00:00
|
|
|
"@OrderFulfillmentRefundProducts",
|
2021-09-27 10:04:21 +00:00
|
|
|
);
|
2021-07-23 09:46:44 +00:00
|
|
|
getOrder(order.id);
|
|
|
|
})
|
|
|
|
.then(orderResp => {
|
2022-08-04 10:59:42 +00:00
|
|
|
expect(orderResp.paymentStatus).to.be.eq("PARTIALLY_REFUNDED");
|
2021-07-23 09:46:44 +00:00
|
|
|
});
|
2022-06-27 16:49:35 +00:00
|
|
|
},
|
2022-06-27 09:30:51 +00:00
|
|
|
);
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
|
|
|
|
it(
|
|
|
|
"should add line item discount (for single product in order) . TC: SALEOR_2125",
|
|
|
|
{ tags: ["@orders", "@allEnv", "@stable"] },
|
|
|
|
() => {
|
|
|
|
const totalPrice = variantPrice + shippingPrice;
|
|
|
|
const inlineDiscount = 0.5;
|
|
|
|
const discountReason = "product damaged";
|
|
|
|
createUnconfirmedOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
|
|
|
shippingMethod,
|
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
}).then(unconfirmedOrderResponse => {
|
|
|
|
cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`);
|
|
|
|
applyFixedLineDiscountForProduct(inlineDiscount, discountReason);
|
|
|
|
cy.get(ORDERS_SELECTORS.priceCellFirstRowOrderDetails).should(
|
|
|
|
"have.text",
|
|
|
|
inlineDiscount,
|
|
|
|
);
|
|
|
|
cy.get(ORDERS_SELECTORS.orderSummarySubtotalPriceRow).should(
|
|
|
|
"contain.text",
|
|
|
|
variantPrice - inlineDiscount,
|
|
|
|
);
|
|
|
|
cy.get(ORDERS_SELECTORS.orderSummaryTotalPriceRow).should(
|
|
|
|
"contain.text",
|
|
|
|
totalPrice - inlineDiscount,
|
|
|
|
);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
|
|
|
it(
|
|
|
|
"should remove product from unconfirmed order . TC: SALEOR_2126",
|
|
|
|
{ tags: ["@orders", "@allEnv", "@stable"] },
|
|
|
|
() => {
|
|
|
|
createUnconfirmedOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
|
|
|
shippingMethod,
|
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
}).then(unconfirmedOrderResponse => {
|
|
|
|
cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`);
|
|
|
|
deleteProductFromGridTableOnIndex(0);
|
|
|
|
cy.contains(MESSAGES.noProductFound).should("be.visible");
|
|
|
|
cy.get(ORDERS_SELECTORS.productDeleteFromRowButton).should("not.exist");
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
it(
|
|
|
|
"should change quantity of products on order detail view . TC: SALEOR_2127",
|
|
|
|
{ tags: ["@orders", "@allEnv", "@stable"] },
|
|
|
|
() => {
|
|
|
|
createUnconfirmedOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
|
|
|
shippingMethod,
|
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
}).then(unconfirmedOrderResponse => {
|
|
|
|
cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`);
|
|
|
|
|
|
|
|
changeQuantityOfProducts();
|
|
|
|
|
|
|
|
cy.get(ORDERS_SELECTORS.orderSummarySubtotalPriceRow).should(
|
|
|
|
"contain.text",
|
|
|
|
variantPrice * 2,
|
|
|
|
);
|
|
|
|
cy.get(ORDERS_SELECTORS.orderSummaryTotalPriceRow).should(
|
|
|
|
"contain.text",
|
|
|
|
shippingPrice + variantPrice * 2,
|
|
|
|
);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
it(
|
|
|
|
"should add new product on order detail view . TC: SALEOR_2128",
|
|
|
|
{ tags: ["@orders", "@allEnv", "@stable"] },
|
|
|
|
() => {
|
|
|
|
createUnconfirmedOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
|
|
|
shippingMethod,
|
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
}).then(unconfirmedOrderResponse => {
|
|
|
|
cy.visit(urlList.orders + `${unconfirmedOrderResponse.order.id}`);
|
|
|
|
cy.get(ORDERS_SELECTORS.dataGridTable).should("be.visible");
|
|
|
|
addNewProductToOrder().then(productName => {
|
|
|
|
cy.get(ORDERS_SELECTORS.productNameSecondRowOrderDetails).should(
|
|
|
|
"contain.text",
|
|
|
|
productName,
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
2023-05-23 11:51:56 +00:00
|
|
|
|
|
|
|
it(
|
|
|
|
"should create metadata and private metadata for fulfilled order . TC: SALEOR_2129",
|
|
|
|
{ tags: ["@orders", "@allEnv", "@stable"] },
|
|
|
|
() => {
|
|
|
|
let order;
|
|
|
|
|
|
|
|
cy.addAliasToGraphRequest("UpdateMetadata");
|
|
|
|
cy.addAliasToGraphRequest("UpdatePrivateMetadata");
|
|
|
|
createFulfilledOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
|
|
|
shippingMethod,
|
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
warehouse: warehouse.id,
|
|
|
|
})
|
|
|
|
.then(({ order: orderResp }) => {
|
|
|
|
order = orderResp;
|
|
|
|
cy.visit(urlList.orders + `${order.id}`);
|
|
|
|
addPublicMetadataFieldFulfillmentOrder(
|
|
|
|
0,
|
|
|
|
metadataName,
|
|
|
|
metadataValue,
|
|
|
|
);
|
|
|
|
addPrivateMetadataFieldFulfillmentOrder(
|
|
|
|
0,
|
|
|
|
privateMetadataName,
|
|
|
|
privateMetadataValue,
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
cy.clickConfirmButton()
|
|
|
|
.waitForRequestAndCheckIfNoErrors("@UpdateMetadata")
|
|
|
|
.waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata");
|
|
|
|
cy.confirmationMessageShouldAppear();
|
|
|
|
getOrder(order.id).then(orderResponse => {
|
|
|
|
// check to see updated fulfillment metadata and private meta data
|
|
|
|
cy.wrap(orderResponse.fulfillments[0].metadata[0]).should(
|
|
|
|
"deep.equal",
|
|
|
|
{
|
|
|
|
key: metadataName,
|
|
|
|
value: metadataValue,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cy.wrap(orderResponse.fulfillments[0].privateMetadata[0]).should(
|
|
|
|
"deep.equal",
|
|
|
|
{
|
|
|
|
key: privateMetadataName,
|
|
|
|
value: privateMetadataValue,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
it(
|
|
|
|
"should update metadata and private metadata for fulfilled order . TC: SALEOR_2130",
|
|
|
|
{ tags: ["@orders", "@allEnv", "@stable"] },
|
|
|
|
() => {
|
|
|
|
cy.addAliasToGraphRequest("UpdateMetadata");
|
|
|
|
cy.addAliasToGraphRequest("UpdatePrivateMetadata");
|
|
|
|
createFulfilledOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
|
|
|
shippingMethod,
|
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
warehouse: warehouse.id,
|
|
|
|
}).then(orderResp => {
|
|
|
|
getOrder(orderResp.order.id).then(orderDetails => {
|
|
|
|
updateMetadata(
|
|
|
|
orderDetails.fulfillments[0].id,
|
|
|
|
metadataName,
|
|
|
|
metadataValue,
|
|
|
|
).then(() => {
|
|
|
|
updatePrivateMetadata(
|
|
|
|
orderDetails.fulfillments[0].id,
|
|
|
|
privateMetadataName,
|
|
|
|
privateMetadataValue,
|
|
|
|
)
|
|
|
|
.then(() => {
|
|
|
|
cy.visit(urlList.orders + `${orderResp.order.id}`);
|
|
|
|
updatePublicMetadataFieldFulfillmentOrder(
|
|
|
|
0,
|
|
|
|
updatedMetadataName,
|
|
|
|
updatedMetadataValue,
|
|
|
|
);
|
|
|
|
updatePrivateMetadataFieldFulfillmentOrder(
|
|
|
|
0,
|
|
|
|
updatedPrivateMetadataName,
|
|
|
|
updatedPrivateMetadataValue,
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
cy.clickConfirmButton()
|
|
|
|
.waitForRequestAndCheckIfNoErrors("@UpdateMetadata")
|
|
|
|
.waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata");
|
|
|
|
cy.confirmationMessageShouldAppear();
|
|
|
|
getOrder(orderResp.order.id).then(orderResponse => {
|
|
|
|
// check to see updated fulfillment metadata and private meta data
|
|
|
|
cy.wrap(orderResponse.fulfillments[0].metadata[0]).should(
|
|
|
|
"deep.equal",
|
|
|
|
{
|
|
|
|
key: updatedMetadataName,
|
|
|
|
value: updatedMetadataValue,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
cy.wrap(
|
|
|
|
orderResponse.fulfillments[0].privateMetadata[0],
|
|
|
|
).should("deep.equal", {
|
|
|
|
key: updatedPrivateMetadataName,
|
|
|
|
value: updatedPrivateMetadataValue,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
it(
|
|
|
|
"should delete metadata and private metadata for fulfilled order . TC: SALEOR_2131",
|
|
|
|
{ tags: ["@orders", "@allEnv", "@stable"] },
|
|
|
|
() => {
|
|
|
|
cy.addAliasToGraphRequest("UpdateMetadata");
|
|
|
|
cy.addAliasToGraphRequest("UpdatePrivateMetadata");
|
|
|
|
createFulfilledOrder({
|
|
|
|
customerId: customer.id,
|
|
|
|
channelId: defaultChannel.id,
|
|
|
|
shippingMethod,
|
|
|
|
variantsList,
|
|
|
|
address,
|
|
|
|
warehouse: warehouse.id,
|
|
|
|
}).then(orderResp => {
|
|
|
|
getOrder(orderResp.order.id).then(orderDetails => {
|
|
|
|
updateMetadata(
|
|
|
|
orderDetails.fulfillments[0].id,
|
|
|
|
metadataName,
|
|
|
|
metadataValue,
|
|
|
|
).then(() => {
|
|
|
|
updatePrivateMetadata(
|
|
|
|
orderDetails.fulfillments[0].id,
|
|
|
|
privateMetadataName,
|
|
|
|
privateMetadataValue,
|
|
|
|
)
|
|
|
|
.then(() => {
|
|
|
|
cy.visit(urlList.orders + `${orderResp.order.id}`);
|
|
|
|
expandPublicFulfillmentMetadata(0);
|
|
|
|
deletePublicFulfillmentMetadata(0, 0);
|
|
|
|
expandPrivateFulfillmentMetadata(0);
|
|
|
|
deletePrivateFulfillmentMetadata(0, 0);
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
cy.clickConfirmButton()
|
|
|
|
.waitForRequestAndCheckIfNoErrors("@UpdateMetadata")
|
|
|
|
.waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata");
|
|
|
|
cy.confirmationMessageShouldAppear();
|
|
|
|
cy.contains(privateMetadataName).should("not.exist");
|
|
|
|
cy.contains(metadataName).should("not.exist");
|
|
|
|
getOrder(orderResp.order.id).then(orderResponse => {
|
|
|
|
// check to see updated fulfillment metadata and private meta data
|
|
|
|
cy.wrap(orderResponse.fulfillments[0].metadata).should(
|
|
|
|
"deep.equal",
|
|
|
|
[],
|
|
|
|
);
|
|
|
|
cy.wrap(orderResponse.fulfillments[0].privateMetadata).should(
|
|
|
|
"deep.equal",
|
|
|
|
[],
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
2021-07-23 09:46:44 +00:00
|
|
|
});
|