Best JavaScript code snippet using wpt
sw-sales-channel-detail-base.spec.js
Source:sw-sales-channel-detail-base.spec.js
1import { shallowMount } from '@vue/test-utils';2import 'src/module/sw-sales-channel/view/sw-sales-channel-detail-base';3const PRODUCT_COMPARISON_TYPE_ID = 'ed535e5722134ac1aa6524f73e26881b';4const STOREFRONT_SALES_CHANNEL_TYPE_ID = '8a243080f92e4c719546314b577cf82b';5function createWrapper(privileges = []) {6 return shallowMount(Shopware.Component.build('sw-sales-channel-detail-base'), {7 stubs: {8 'sw-card': true,9 'sw-field': true,10 'sw-container': true,11 'sw-entity-single-select': true,12 'sw-sales-channel-defaults-select': true,13 'router-link': true,14 'sw-icon': true,15 'sw-button': true,16 'sw-radio-field': true,17 'sw-multi-tag-ip-select': true18 },19 provide: {20 salesChannelService: {},21 productExportService: {},22 knownIpsService: {23 getKnownIps: () => Promise.resolve()24 },25 repositoryFactory: {},26 acl: {27 can: (identifier) => {28 if (!identifier) { return true; }29 return privileges.includes(identifier);30 }31 }32 },33 propsData: {34 salesChannel: {},35 productExport: {},36 customFieldSets: []37 }38 });39}40describe('src/module/sw-sales-channel/view/sw-sales-channel-detail-base', () => {41 it('should be a Vue.js component', async () => {42 const wrapper = createWrapper();43 expect(wrapper.vm).toBeTruthy();44 });45 it('should have the select template field disabled', async () => {46 const wrapper = createWrapper();47 await wrapper.setProps({48 salesChannel: {49 typeId: PRODUCT_COMPARISON_TYPE_ID50 }51 });52 const selectField = wrapper.find(53 'sw-select-field[placeholder="sw-sales-channel.detail.productComparison.templates.placeholderSelectTemplate"]'54 );55 expect(selectField.attributes().disabled).toBe('true');56 });57 it('should have the select template field enabled', async () => {58 const wrapper = createWrapper([59 'sales_channel.editor'60 ]);61 await wrapper.setProps({62 salesChannel: {63 typeId: PRODUCT_COMPARISON_TYPE_ID64 }65 });66 const selectField = wrapper.find(67 'sw-select-field[placeholder="sw-sales-channel.detail.productComparison.templates.placeholderSelectTemplate"]'68 );69 expect(selectField.attributes().disabled).toBeUndefined();70 });71 it('should have the name field disabled', async () => {72 const wrapper = createWrapper();73 await wrapper.setProps({74 salesChannel: {75 typeId: PRODUCT_COMPARISON_TYPE_ID76 }77 });78 const field = wrapper.find(79 'sw-field-stub[placeholder="sw-sales-channel.detail.placeholderName"]'80 );81 expect(field.attributes().disabled).toBe('true');82 });83 it('should have the name field enabled', async () => {84 const wrapper = createWrapper([85 'sales_channel.editor'86 ]);87 await wrapper.setProps({88 salesChannel: {89 typeId: PRODUCT_COMPARISON_TYPE_ID90 }91 });92 const field = wrapper.find(93 'sw-field-stub[placeholder="sw-sales-channel.detail.placeholderName"]'94 );95 expect(field.attributes().disabled).toBeUndefined();96 });97 it('should have the navigation category id field disabled', async () => {98 const wrapper = createWrapper();99 const field = wrapper.find(100 '.sw-sales-channel-detail__select-navigation-category-id'101 );102 expect(field.attributes().disabled).toBe('true');103 });104 it('should have the navigation category id field enabled', async () => {105 const wrapper = createWrapper([106 'sales_channel.editor'107 ]);108 const field = wrapper.find(109 '.sw-sales-channel-detail__select-navigation-category-id'110 );111 expect(field.attributes().disabled).toBeUndefined();112 });113 it('should have the navigation category depth field disabled', async () => {114 const wrapper = createWrapper();115 const field = wrapper.find(116 'sw-field-stub[label="sw-sales-channel.detail.navigationCategoryDepth"]'117 );118 expect(field.attributes().disabled).toBe('true');119 });120 it('should have the navigation category depth field enabled', async () => {121 const wrapper = createWrapper([122 'sales_channel.editor'123 ]);124 const field = wrapper.find(125 'sw-field-stub[label="sw-sales-channel.detail.navigationCategoryDepth"]'126 );127 expect(field.attributes().disabled).toBeUndefined();128 });129 it('should have the service category id field disabled', async () => {130 const wrapper = createWrapper();131 const field = wrapper.find(132 '.sw-sales-channel-detail__select-service-category-id'133 );134 expect(field.attributes().disabled).toBe('true');135 });136 it('should have the service category id field enabled', async () => {137 const wrapper = createWrapper([138 'sales_channel.editor'139 ]);140 const field = wrapper.find(141 '.sw-sales-channel-detail__select-service-category-id'142 );143 expect(field.attributes().disabled).toBeUndefined();144 });145 it('should have the customer group id field disabled', async () => {146 const wrapper = createWrapper();147 const field = wrapper.find(148 '.sw-sales-channel-detail__select-service-category-id'149 );150 expect(field.attributes().disabled).toBe('true');151 });152 it('should have the customer group id field enabled', async () => {153 const wrapper = createWrapper([154 'sales_channel.editor'155 ]);156 const field = wrapper.find(157 '.sw-sales-channel-detail__select-service-category-id'158 );159 expect(field.attributes().disabled).toBeUndefined();160 });161 it('should have the sales channel defaults select for countries field disabled', async () => {162 const wrapper = createWrapper();163 const field = wrapper.find(164 'sw-sales-channel-defaults-select-stub[propertyname="countries"]'165 );166 expect(field.attributes().disabled).toBe('true');167 });168 it('should have the sales channel defaults select for countries field enabled', async () => {169 const wrapper = createWrapper([170 'sales_channel.editor'171 ]);172 const field = wrapper.find(173 'sw-sales-channel-defaults-select-stub[propertyname="countries"]'174 );175 expect(field.attributes().disabled).toBeUndefined();176 });177 it('should have the sales channel defaults select for languages field disabled', async () => {178 const wrapper = createWrapper();179 const field = wrapper.find(180 'sw-sales-channel-defaults-select-stub[propertyname="languages"]'181 );182 expect(field.attributes().disabled).toBe('true');183 });184 it('should have the sales channel defaults select for languages field enabled', async () => {185 const wrapper = createWrapper([186 'sales_channel.editor'187 ]);188 const field = wrapper.find(189 'sw-sales-channel-defaults-select-stub[propertyname="languages"]'190 );191 expect(field.attributes().disabled).toBeUndefined();192 });193 it('should have the sales channel defaults select for paymentMethods field disabled', async () => {194 const wrapper = createWrapper();195 const field = wrapper.find(196 'sw-sales-channel-defaults-select-stub[propertyname="paymentMethods"]'197 );198 expect(field.attributes().disabled).toBe('true');199 });200 it('should have the sales channel defaults select for paymentMethods field enabled', async () => {201 const wrapper = createWrapper([202 'sales_channel.editor'203 ]);204 const field = wrapper.find(205 'sw-sales-channel-defaults-select-stub[propertyname="paymentMethods"]'206 );207 expect(field.attributes().disabled).toBeUndefined();208 });209 it('should have the sales channel defaults select for shippingMethods field disabled', async () => {210 const wrapper = createWrapper();211 const field = wrapper.find(212 'sw-sales-channel-defaults-select-stub[propertyname="shippingMethods"]'213 );214 expect(field.attributes().disabled).toBe('true');215 });216 it('should have the sales channel defaults select for shippingMethods field enabled', async () => {217 const wrapper = createWrapper([218 'sales_channel.editor'219 ]);220 const field = wrapper.find(221 'sw-sales-channel-defaults-select-stub[propertyname="shippingMethods"]'222 );223 expect(field.attributes().disabled).toBeUndefined();224 });225 it('should have the sales channel defaults select for currencies field disabled', async () => {226 const wrapper = createWrapper();227 const field = wrapper.find(228 'sw-sales-channel-defaults-select-stub[propertyname="currencies"]'229 );230 expect(field.attributes().disabled).toBe('true');231 });232 it('should have the sales channel defaults select for currencies field enabled', async () => {233 const wrapper = createWrapper([234 'sales_channel.editor'235 ]);236 const field = wrapper.find(237 'sw-sales-channel-defaults-select-stub[propertyname="currencies"]'238 );239 expect(field.attributes().disabled).toBeUndefined();240 });241 it('should have the radio select field for taxCalculationType disabled', async () => {242 const wrapper = createWrapper();243 const field = wrapper.find(244 '.sw-sales-channel-detail__tax-calculation'245 );246 expect(field.attributes().disabled).toBe('true');247 });248 it('should have the radio select field for taxCalculationType enabled', async () => {249 const wrapper = createWrapper([250 'sales_channel.editor'251 ]);252 const field = wrapper.find(253 '.sw-sales-channel-detail__tax-calculation'254 );255 expect(field.attributes().disabled).toBeUndefined();256 });257 it('should have the sales-channel-detail-hreflang component disabled', async () => {258 const wrapper = createWrapper();259 await wrapper.setProps({260 salesChannel: {261 typeId: STOREFRONT_SALES_CHANNEL_TYPE_ID262 }263 });264 const field = wrapper.find(265 'sw-sales-channel-detail-hreflang'266 );267 expect(field.attributes().disabled).toBe('true');268 });269 it('should have the sales-channel-detail-hreflang component enabled', async () => {270 const wrapper = createWrapper([271 'sales_channel.editor'272 ]);273 await wrapper.setProps({274 salesChannel: {275 typeId: STOREFRONT_SALES_CHANNEL_TYPE_ID276 }277 });278 const field = wrapper.find(279 'sw-sales-channel-detail-hreflang'280 );281 expect(field.attributes().disabled).toBeUndefined();282 });283 it('should have the sales-channel-detail-domains component disabled', async () => {284 const wrapper = createWrapper();285 await wrapper.setProps({286 salesChannel: {287 typeId: STOREFRONT_SALES_CHANNEL_TYPE_ID288 }289 });290 const field = wrapper.find(291 'sw-sales-channel-detail-domains'292 );293 expect(field.attributes().disableedit).toBe('true');294 });295 it('should have the sales-channel-detail-domains component enabled', async () => {296 const wrapper = createWrapper([297 'sales_channel.editor'298 ]);299 await wrapper.setProps({300 salesChannel: {301 typeId: STOREFRONT_SALES_CHANNEL_TYPE_ID302 }303 });304 const field = wrapper.find(305 'sw-sales-channel-detail-domains'306 );307 expect(field.attributes().disableedit).toBeUndefined();308 });309 it('should have the select field for product export storefront sales channel id disabled', async () => {310 const wrapper = createWrapper();311 await wrapper.setProps({312 salesChannel: {313 typeId: PRODUCT_COMPARISON_TYPE_ID314 }315 });316 const field = wrapper.find(317 '.sw-sales-channel-detail__product-comparison-storefront'318 );319 expect(field.attributes().disabled).toBe('true');320 });321 it('should have the select field for product export storefront sales channel id enabled', async () => {322 const wrapper = createWrapper([323 'sales_channel.editor'324 ]);325 await wrapper.setProps({326 salesChannel: {327 typeId: PRODUCT_COMPARISON_TYPE_ID328 }329 });330 const field = wrapper.find(331 '.sw-sales-channel-detail__product-comparison-storefront'332 );333 expect(field.attributes().disabled).toBeUndefined();334 });335 it('should have the select field for product export sales channel domain id disabled', async () => {336 const wrapper = createWrapper();337 await wrapper.setProps({338 salesChannel: {339 typeId: PRODUCT_COMPARISON_TYPE_ID340 },341 productExport: {342 salesChannelDomainId: '1a',343 storefrontSalesChannelId: '2b'344 }345 });346 const field = wrapper.find(347 '.sw-sales-channel-detail__product-comparison-domain'348 );349 expect(field.attributes().disabled).toBe('true');350 });351 it('should have the select field for product export sales channel domain id enabled', async () => {352 const wrapper = createWrapper([353 'sales_channel.editor'354 ]);355 await wrapper.setProps({356 salesChannel: {357 typeId: PRODUCT_COMPARISON_TYPE_ID358 },359 productExport: {360 salesChannelDomainId: '1a',361 storefrontSalesChannelId: '2b'362 }363 });364 const field = wrapper.find(365 '.sw-sales-channel-detail__product-comparison-domain'366 );367 expect(field.attributes().disabled).toBeUndefined();368 });369 it('should have the select field for product export currency id disabled', async () => {370 const wrapper = createWrapper();371 await wrapper.setProps({372 salesChannel: {373 typeId: PRODUCT_COMPARISON_TYPE_ID374 },375 productExport: {376 salesChannelDomain: {}377 }378 });379 const field = wrapper.find(380 'sw-entity-single-select-stub[entity="currency"]'381 );382 expect(field.attributes().disabled).toBe('true');383 });384 it('should have the select field for product export currency id enabled', async () => {385 const wrapper = createWrapper([386 'sales_channel.editor'387 ]);388 await wrapper.setProps({389 salesChannel: {390 typeId: PRODUCT_COMPARISON_TYPE_ID391 },392 productExport: {393 salesChannelDomain: {}394 }395 });396 const field = wrapper.find(397 'sw-entity-single-select-stub[entity="currency"]'398 );399 expect(field.attributes().disabled).toBeUndefined();400 });401 it('should have the select field for product export sales channel domain language id disabled', async () => {402 const wrapper = createWrapper();403 await wrapper.setProps({404 salesChannel: {405 typeId: PRODUCT_COMPARISON_TYPE_ID406 },407 productExport: {408 salesChannelDomain: {}409 }410 });411 const field = wrapper.find(412 'sw-entity-single-select-stub[entity="language"]'413 );414 expect(field.attributes().disabled).toBe('true');415 });416 it('should have the select field for product export sales channel domain language id disabled', async () => {417 const wrapper = createWrapper([418 'sales_channel.editor'419 ]);420 await wrapper.setProps({421 salesChannel: {422 typeId: PRODUCT_COMPARISON_TYPE_ID423 },424 productExport: {425 salesChannelDomain: {}426 }427 });428 const field = wrapper.find(429 'sw-entity-single-select-stub[entity="language"]'430 );431 expect(field.attributes().disabled).toBe('true');432 });433 it('should have the select field for product export sales channel customer group id disabled', async () => {434 const wrapper = createWrapper();435 await wrapper.setProps({436 salesChannel: {437 typeId: PRODUCT_COMPARISON_TYPE_ID438 },439 productExport: {440 salesChannelDomain: {}441 }442 });443 const field = wrapper.find(444 'sw-entity-single-select-stub[entity="customer_group"]'445 );446 expect(field.attributes().disabled).toBe('true');447 });448 it('should have the select field for product export sales channel customer group id disabled', async () => {449 const wrapper = createWrapper([450 'sales_channel.editor'451 ]);452 await wrapper.setProps({453 salesChannel: {454 typeId: PRODUCT_COMPARISON_TYPE_ID455 },456 productExport: {457 salesChannelDomain: {}458 }459 });460 const field = wrapper.find(461 'sw-entity-single-select-stub[entity="customer_group"]'462 );463 expect(field.attributes().disabled).toBe('true');464 });465 it('should have the field for product export file name disabled', async () => {466 const wrapper = createWrapper();467 await wrapper.setProps({468 salesChannel: {469 typeId: PRODUCT_COMPARISON_TYPE_ID470 }471 });472 const field = wrapper.find(473 'sw-field-stub[placeholder="sw-sales-channel.detail.productComparison.placeholderFileName"]'474 );475 expect(field.attributes().disabled).toBe('true');476 });477 it('should have the field for product export file name enabled', async () => {478 const wrapper = createWrapper([479 'sales_channel.editor'480 ]);481 await wrapper.setProps({482 salesChannel: {483 typeId: PRODUCT_COMPARISON_TYPE_ID484 }485 });486 const field = wrapper.find(487 'sw-field-stub[placeholder="sw-sales-channel.detail.productComparison.placeholderFileName"]'488 );489 expect(field.attributes().disabled).toBeUndefined();490 });491 it('should have the select field for product export encoding disabled', async () => {492 const wrapper = createWrapper();493 await wrapper.setProps({494 salesChannel: {495 typeId: PRODUCT_COMPARISON_TYPE_ID496 }497 });498 const field = wrapper.find(499 'sw-select-field[placeholder="sw-sales-channel.detail.productComparison.placeholderSelectEncoding"]'500 );501 expect(field.attributes().disabled).toBe('true');502 });503 it('should have the select field for product export encoding enabled', async () => {504 const wrapper = createWrapper([505 'sales_channel.editor'506 ]);507 await wrapper.setProps({508 salesChannel: {509 typeId: PRODUCT_COMPARISON_TYPE_ID510 }511 });512 const field = wrapper.find(513 'sw-select-field[placeholder="sw-sales-channel.detail.productComparison.placeholderSelectEncoding"]'514 );515 expect(field.attributes().disabled).toBeUndefined();516 });517 it('should have the select field for product export file format disabled', async () => {518 const wrapper = createWrapper();519 await wrapper.setProps({520 salesChannel: {521 typeId: PRODUCT_COMPARISON_TYPE_ID522 }523 });524 const field = wrapper.find(525 'sw-select-field[placeholder="sw-sales-channel.detail.productComparison.placeholderSelectFileFormat"]'526 );527 expect(field.attributes().disabled).toBe('true');528 });529 it('should have the select field for product export file format enabled', async () => {530 const wrapper = createWrapper([531 'sales_channel.editor'532 ]);533 await wrapper.setProps({534 salesChannel: {535 typeId: PRODUCT_COMPARISON_TYPE_ID536 }537 });538 const field = wrapper.find(539 'sw-select-field[placeholder="sw-sales-channel.detail.productComparison.placeholderSelectFileFormat"]'540 );541 expect(field.attributes().disabled).toBeUndefined();542 });543 it('should have the field for product export includeVariants disabled', async () => {544 const wrapper = createWrapper();545 await wrapper.setProps({546 salesChannel: {547 typeId: PRODUCT_COMPARISON_TYPE_ID548 }549 });550 const field = wrapper.find(551 'sw-field-stub[label="sw-sales-channel.detail.productComparison.includeVariants"]'552 );553 expect(field.attributes().disabled).toBe('true');554 });555 it('should have the field for product export includeVariants enabled', async () => {556 const wrapper = createWrapper([557 'sales_channel.editor'558 ]);559 await wrapper.setProps({560 salesChannel: {561 typeId: PRODUCT_COMPARISON_TYPE_ID562 }563 });564 const field = wrapper.find(565 'sw-field-stub[label="sw-sales-channel.detail.productComparison.includeVariants"]'566 );567 expect(field.attributes().disabled).toBeUndefined();568 });569 it('should have the select number field for product export interval disabled', async () => {570 const wrapper = createWrapper();571 await wrapper.setProps({572 salesChannel: {573 typeId: PRODUCT_COMPARISON_TYPE_ID574 }575 });576 const field = wrapper.find(577 'sw-select-number-field[label="sw-sales-channel.detail.productComparison.interval"]'578 );579 expect(field.attributes().disabled).toBe('true');580 });581 it('should have the select number field for product export interval enabled', async () => {582 const wrapper = createWrapper([583 'sales_channel.editor'584 ]);585 await wrapper.setProps({586 salesChannel: {587 typeId: PRODUCT_COMPARISON_TYPE_ID588 }589 });590 const field = wrapper.find(591 'sw-select-number-field[label="sw-sales-channel.detail.productComparison.interval"]'592 );593 expect(field.attributes().disabled).toBeUndefined();594 });595 it('should have the switch field for product export generateByCronjob disabled', async () => {596 const wrapper = createWrapper();597 await wrapper.setProps({598 salesChannel: {599 typeId: PRODUCT_COMPARISON_TYPE_ID600 }601 });602 const field = wrapper.find(603 'sw-field-stub[label="sw-sales-channel.detail.productComparison.generateByCronjob"]'604 );605 expect(field.attributes().disabled).toBe('true');606 });607 it('should have the switch field for product export generateByCronjob enabled', async () => {608 const wrapper = createWrapper([609 'sales_channel.editor'610 ]);611 await wrapper.setProps({612 salesChannel: {613 typeId: PRODUCT_COMPARISON_TYPE_ID614 }615 });616 const field = wrapper.find(617 'sw-field-stub[label="sw-sales-channel.detail.productComparison.generateByCronjob"]'618 );619 expect(field.attributes().disabled).toBeUndefined();620 });621 it('should have the entity single field for product export productStreamId disabled', async () => {622 const wrapper = createWrapper();623 await wrapper.setProps({624 salesChannel: {625 typeId: PRODUCT_COMPARISON_TYPE_ID626 }627 });628 const field = wrapper.find(629 '.sw-sales-channel-detail__product-comparison-product-stream'630 );631 expect(field.attributes().disabled).toBe('true');632 });633 it('should have the entity single field for product export productStreamId enabled', async () => {634 const wrapper = createWrapper([635 'sales_channel.editor'636 ]);637 await wrapper.setProps({638 salesChannel: {639 typeId: PRODUCT_COMPARISON_TYPE_ID640 }641 });642 const field = wrapper.find(643 '.sw-sales-channel-detail__product-comparison-product-stream'644 );645 expect(field.attributes().disabled).toBeUndefined();646 });647 it('should have the field for salesChannel accessKey disabled', async () => {648 const wrapper = createWrapper();649 await wrapper.setProps({650 salesChannel: {}651 });652 const field = wrapper.find(653 'sw-field-stub[label="sw-sales-channel.detail.labelAccessKeyField"]'654 );655 expect(field.attributes().disabled).toBe('true');656 });657 it('should have the field for salesChannel accessKey disabled', async () => {658 const wrapper = createWrapper([659 'sales_channel.editor'660 ]);661 await wrapper.setProps({662 salesChannel: {}663 });664 const field = wrapper.find(665 'sw-field-stub[label="sw-sales-channel.detail.labelAccessKeyField"]'666 );667 expect(field.attributes().disabled).toBe('true');668 });669 it('should have the button for generate keys disabled', async () => {670 const wrapper = createWrapper();671 await wrapper.setProps({672 salesChannel: {}673 });674 const field = wrapper.find(675 '.sw-sales-channel-detail-base__button-generate-keys'676 );677 expect(field.attributes().disabled).toBe('true');678 });679 it('should have the button for generate keys enabled', async () => {680 const wrapper = createWrapper([681 'sales_channel.editor'682 ]);683 await wrapper.setProps({684 salesChannel: {}685 });686 const field = wrapper.find(687 '.sw-sales-channel-detail-base__button-generate-keys'688 );689 expect(field.attributes().disabled).toBeUndefined();690 });691 it('should have the field for productExport accesKey disabled', async () => {692 const wrapper = createWrapper();693 await wrapper.setProps({694 salesChannel: {695 typeId: PRODUCT_COMPARISON_TYPE_ID696 }697 });698 const field = wrapper.find(699 'sw-field-stub[label="sw-sales-channel.detail.productComparison.accessKey"]'700 );701 expect(field.attributes().disabled).toBe('true');702 });703 it('should have the field for productExport accesKey disabled', async () => {704 const wrapper = createWrapper([705 'sales_channel.editor'706 ]);707 await wrapper.setProps({708 salesChannel: {709 typeId: PRODUCT_COMPARISON_TYPE_ID710 }711 });712 const field = wrapper.find(713 'sw-field-stub[label="sw-sales-channel.detail.productComparison.accessKey"]'714 );715 expect(field.attributes().disabled).toBe('true');716 });717 it('should have the field for productExport accesUrl disabled', async () => {718 const wrapper = createWrapper();719 await wrapper.setProps({720 salesChannel: {721 typeId: PRODUCT_COMPARISON_TYPE_ID722 },723 productExport: {724 salesChannelDomainId: '1a2b3c'725 }726 });727 const field = wrapper.find(728 'sw-field-stub[label="sw-sales-channel.detail.productComparison.accessUrl"]'729 );730 expect(field.attributes().disabled).toBe('true');731 });732 it('should have the field for productExport accesUrl disabled', async () => {733 const wrapper = createWrapper([734 'sales_channel.editor'735 ]);736 await wrapper.setProps({737 salesChannel: {738 typeId: PRODUCT_COMPARISON_TYPE_ID739 },740 productExport: {741 salesChannelDomainId: '1a2b3c'742 }743 });744 const field = wrapper.find(745 'sw-field-stub[label="sw-sales-channel.detail.productComparison.accessUrl"]'746 );747 expect(field.attributes().disabled).toBe('true');748 });749 it('should have the button for generating the keys disabled', async () => {750 const wrapper = createWrapper();751 const field = wrapper.find(752 '.sw-sales-channel-detail-base__button-generate-keys'753 );754 expect(field.attributes().disabled).toBe('true');755 });756 it('should have the button for generating the keys enabled', async () => {757 const wrapper = createWrapper([758 'sales_channel.editor'759 ]);760 const field = wrapper.find(761 '.sw-sales-channel-detail-base__button-generate-keys'762 );763 expect(field.attributes().disabled).toBeUndefined();764 });765 it('should have the switch field for salesChannel active disabled', async () => {766 const wrapper = createWrapper();767 const field = wrapper.find(768 'sw-field-stub[label="sw-sales-channel.detail.labelInputActive"]'769 );770 expect(field.attributes().disabled).toBe('true');771 });772 it('should have the switch field for salesChannel active enabled', async () => {773 const wrapper = createWrapper([774 'sales_channel.editor'775 ]);776 const field = wrapper.find(777 'sw-field-stub[label="sw-sales-channel.detail.labelInputActive"]'778 );779 expect(field.attributes().disabled).toBeUndefined();780 });781 it('should have the switch field for salesChannel maintenance disabled', async () => {782 const wrapper = createWrapper();783 const field = wrapper.find(784 'sw-field-stub[label="sw-sales-channel.detail.labelMaintenanceActive"]'785 );786 expect(field.attributes().disabled).toBe('true');787 });788 it('should have the switch field for salesChannel maintenance enabled', async () => {789 const wrapper = createWrapper([790 'sales_channel.editor'791 ]);792 const field = wrapper.find(793 'sw-field-stub[label="sw-sales-channel.detail.labelMaintenanceActive"]'794 );795 expect(field.attributes().disabled).toBeUndefined();796 });797 it('should have the field multi tag ip select for maintenanceIpWhitelist disabled', async () => {798 const wrapper = createWrapper();799 const field = wrapper.find(800 'sw-multi-tag-ip-select-stub[label="sw-sales-channel.detail.ipAddressWhitleList"]'801 );802 expect(field.attributes().disabled).toBe('true');803 });804 it('should have the field multi tag ip select for maintenanceIpWhitelist enabled', async () => {805 const wrapper = createWrapper([806 'sales_channel.editor'807 ]);808 const field = wrapper.find(809 'sw-multi-tag-ip-select-stub[label="sw-sales-channel.detail.ipAddressWhitleList"]'810 );811 expect(field.attributes().disabled).toBeUndefined();812 });...
SimpleTab.test.js
Source:SimpleTab.test.js
...49 />50 </Router>51 );52 it('renders Payment without crashing', () => {53 const wrapper = createWrapper(Payment);54 wrapper.unmount();55 });56 it('renders Payment (convert) without crashing', () => {57 const wrapper = createWrapper(PaymentConvert);58 wrapper.unmount();59 });60 it('renders AccountDelete without crashing', () => {61 const wrapper = createShallowWrapper(AccountDelete);62 wrapper.unmount();63 });64 it('renders AccountSet without crashing', () => {65 const wrapper = createWrapper(AccountSet);66 wrapper.unmount();67 });68 it('renders EscrowCreate without crashing', () => {69 const wrapper = createWrapper(EscrowCreate);70 wrapper.unmount();71 });72 it('renders EscrowCancel without crashing', () => {73 const wrapper = createWrapper(EscrowCancel);74 wrapper.unmount();75 });76 it('renders EscrowFinish without crashing', () => {77 const wrapper = createWrapper(EscrowFinish);78 wrapper.unmount();79 });80 it('renders EnableAmendment without crashing', () => {81 const wrapper = createWrapper(EnableAmendment);82 wrapper.unmount();83 });84 it('renders OfferCreate without crashing', () => {85 const wrapper = createWrapper(OfferCreate);86 wrapper.unmount();87 });88 it('renders OfferCancel without crashing', () => {89 const wrapper = createWrapper(OfferCancel);90 wrapper.unmount();91 });92 it('renders PaymentChannelClaim without crashing', () => {93 const wrapper = createWrapper(PaymentChannelClaim);94 wrapper.unmount();95 });96 it('renders PaymentChannelCreate without crashing', () => {97 const wrapper = createWrapper(PaymentChannelCreate);98 wrapper.unmount();99 });100 it('renders PaymentChannelFund without crashing', () => {101 const wrapper = createWrapper(PaymentChannelFund);102 wrapper.unmount();103 });104 it('renders SetRegularKey without crashing', () => {105 const wrapper = createWrapper(SetRegularKey);106 wrapper.unmount();107 });108 it('renders SignerListSet without crashing', () => {109 const wrapper = createWrapper(SignerListSet);110 wrapper.unmount();111 });112 it('renders DepositPreauth without crashing', () => {113 const wrapper = createWrapper(DepositPreauth);114 wrapper.unmount();115 });116 it('renders TrustSet without crashing', () => {117 const wrapper = createWrapper(TrustSet);118 wrapper.unmount();119 });120 it('renders UNLModify without crashing', () => {121 const wrapper = createWrapper(UNLModify);122 wrapper.unmount();123 });124 it('renders TicketCreate without crashing', () => {125 const wrapper = createWrapper(TicketCreate);126 wrapper.unmount();127 });128 it('renders simple tab information', () => {129 const wrapper = createWrapper(Payment);130 expect(wrapper.find('.simple-body').length).toBe(1);131 expect(wrapper.find('a').length).toBe(3);132 const index = wrapper.find('.index');133 expect(index.length).toBe(1);134 expect(index.contains(<div className="title">formatted_date</div>)).toBe(true);135 expect(index.contains(<div className="title">ledger_index</div>)).toBe(true);136 expect(index.contains(<div className="title">transaction_cost</div>)).toBe(true);137 expect(index.contains(<div className="title">sequence_number</div>)).toBe(true);138 wrapper.unmount();139 });140 it('renders ticket count', () => {141 const wrapper = createWrapper(TicketCreate, 800);142 expect(wrapper.find('.simple-body').length).toBe(1);143 const ticketCount = wrapper.find('.ticket-count');144 expect(ticketCount.length).toBe(1);145 wrapper.unmount();146 });...
txDetails.test.js
Source:txDetails.test.js
...32 />33 </I18nextProvider>34 );35 it('renders Payment without crashing', () => {36 const wrapper = createWrapper(Payment);37 wrapper.unmount();38 });39 it('renders Payment (convert) without crashing', () => {40 const wrapper = createWrapper(ConvertPayment);41 wrapper.unmount();42 });43 it('renders AccountSet without crashing', () => {44 const wrapper = createWrapper(AccountSet);45 wrapper.unmount();46 });47 it('renders EnableAmendment without crashing', () => {48 const wrapper = createWrapper(EnableAmendment);49 wrapper.unmount();50 });51 it('renders EscrowCreate without crashing', () => {52 const wrapper = createWrapper(EscrowCreate);53 wrapper.unmount();54 });55 it('renders EscrowCancel without crashing', () => {56 const wrapper = createWrapper(EscrowCancel);57 wrapper.unmount();58 });59 it('renders EscrowFinish without crashing', () => {60 const wrapper = createWrapper(EscrowFinish);61 wrapper.unmount();62 });63 it('renders OfferCreate without crashing', () => {64 const wrapper = createWrapper(OfferCreate);65 wrapper.unmount();66 });67 it('renders OfferCancel without crashing', () => {68 const wrapper = createWrapper(OfferCancel);69 wrapper.unmount();70 });71 it('renders PaymentChannelCreate without crashing', () => {72 const wrapper = createWrapper(PaymentChannelCreate);73 wrapper.unmount();74 });75 it('renders PaymentChannelFund without crashing', () => {76 const wrapper = createWrapper(PaymentChannelFund);77 wrapper.unmount();78 });79 it('renders PaymentChannelClaim without crashing', () => {80 const wrapper = createWrapper(PaymentChannelClaim);81 wrapper.unmount();82 });83 it('renders SetRegularKey without crashing', () => {84 const wrapper = createWrapper(SetRegularKey);85 wrapper.unmount();86 });87 it('renders SignerListSet without crashing', () => {88 const wrapper = createWrapper(SignerListSet);89 wrapper.unmount();90 });91 it('renders TrustSet without crashing', () => {92 const wrapper = createWrapper(TrustSet);93 wrapper.unmount();94 });95 it('renders UNLModify without crashing', () => {96 const wrapper = createWrapper(UNLModify);97 wrapper.unmount();98 });...
Using AI Code Generation
1var wpt = require('webpagetest');2var webpagetest = new wpt('www.webpagetest.org');3webpagetest.createWrapper({4 lighthouseConfig: {5 settings: {6 throttling: {7 },8 },9 },
Using AI Code Generation
1var wpt = require('wpt-api');2var wpt = new WebPageTest('www.webpagetest.org');3var options = {4};5wpt.createWrapper(options, function(err, data) {6 console.log(data);7});8var wpt = require('wpt-api');9var wpt = new WebPageTest('www.webpagetest.org');10var options = {11};12wpt.getTestResults(options, function(err, data) {13 console.log(data);14});15var wpt = require('wpt-api');16var wpt = new WebPageTest('www.webpagetest.org');17wpt.getLocations(function(err, data) {18 console.log(data);19});20var wpt = require('wpt-api');21var wpt = new WebPageTest('www.webpagetest.org');22wpt.getTesters(function(err, data) {23 console.log(data);24});25var wpt = require('wpt-api');26var wpt = new WebPageTest('www.webpagetest.org');27var options = {28};29wpt.getTestStatus(options, function(err, data) {30 console.log(data);31});32var wpt = require('wpt-api');33var wpt = new WebPageTest('www.webpagetest.org');34var options = {35};
Using AI Code Generation
1const wptoolkit = require('wptoolkit');2const result = wrapper.get('/wp-json/wp/v2/posts');3console.log(result);4const wptoolkit = require('wptoolkit');5const result = wrapper.post('/wp-json/wp/v2/posts', {6});7console.log(result);8const wptoolkit = require('wptoolkit');9const result = wrapper.put('/wp-json/wp/v2/posts/1', {10});11console.log(result);12const wptoolkit = require('wptoolkit');13const result = wrapper.delete('/wp-json/wp/v2/posts/1');14console.log(result);15const wptoolkit = require('wptoolkit');16const result = wrapper.get('/wp-json/wp/v2/posts', {17});18console.log(result);19const wptoolkit = require('wptoolkit');20const result = wrapper.get('/wp-json/wp/v2/posts', {21});22console.log(result);23const wptoolkit = require('wptoolkit');
Using AI Code Generation
1var wrapper = createWrapper();2wrapper.addFile("test.html");3wrapper.addFile("test.js");4wrapper.addFile("test.css");5wrapper.addFile("test.png");6wrapper.runTest();7var test = async_test("Test for test.js");8test.step(function() {9 var img = document.querySelector("img");10 test.done();11});12img {13 width: 100px;14 height: 100px;15}16var test = async_test("Test for test.js");17test.step(function() {18 var img = document.querySelector("img");19 test.done();20});21var test = async_test("Test for test.js");22test.step(function() {23 var img = document.querySelector("img");24 test.done();25});26var test = async_test("Test for test.js");27test.step(function() {28 var img = document.querySelector("img");29 test.done();30});31var test = async_test("Test for test.js");32test.step(function() {33 var img = document.querySelector("img");34 test.done();35});
Using AI Code Generation
1var wpt = require('webpagetest');2var test = new wpt('www.webpagetest.org', 'A.9f8d9a9d2e1e7d0f0b8d7b8f3b3b3b3b');3var options = {4};5test.createTest(options, function(err, data) {6 if (err) return console.error(err);7 console.log(data);8});9var wpt = require('webpagetest');10var test = new wpt('www.webpagetest.org', 'A.9f8d9a9d2e1e7d0f0b8d7b8f3b3b3b3b');11var options = {12};13test.runTest(options, function(err, data) {14 if (err) return console.error(err);15 console.log(data);16});17var wpt = require('webpagetest');18var test = new wpt('www.webpagetest.org', 'A.9f8d9a9d2e1e7d0f0b8d7b8f3b3b3b3b');19test.getLocations(function(err, data) {20 if (err) return console.error(err);21 console.log(data);22});23var wpt = require('webpagetest');24var test = new wpt('www.webpagetest.org', 'A.9f8d9a9d2e1e7d0f0b8d7b8f3b3b3b3b');25test.getTesters(function(err, data) {26 if (err) return console.error(err);27 console.log(data);28});29var wpt = require('webpagetest');
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!