Skip to content

Commit

Permalink
Merge pull request #2043 from embroider-build/fix-static-app-test
Browse files Browse the repository at this point in the history
Fix/ static-app-test shoudn't use an `isClassic` macro
  • Loading branch information
ef4 committed Jul 12, 2024
2 parents 3b061c2 + 05f85fc commit 203b5bc
Showing 1 changed file with 2 additions and 40 deletions.
42 changes: 2 additions & 40 deletions tests/scenarios/static-app-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ wideAppScenarios
<div data-helper-name={{name}}>{{name}}</div>
{{/each}}
`,
'macros-example.hbs': `
<h1 data-macro>Welcome to this {{#if (macroCondition (macroGetOwnConfig "isClassic"))}}classic{{else}}embroider{{/if}} app!</h1>
`,
'static-component-rules-example.hbs': `
<FancyBox @title="With Default" />
<FancyBox @title="With Custom" @titleComponent="my-title" />
Expand Down Expand Up @@ -250,12 +247,7 @@ wideAppScenarios
let components = [...document.querySelectorAll("[data-component-name]")].map(elt => elt.dataset.componentName);
assert.ok(!components.includes('bs-button'), 'expected not to find bs-button because it got inserted via lexical scope');
if (getOwnConfig().isClassic) {
assert.ok(components.includes('bs-carousel'), 'expected to find bs-carousel in classic build');
} else {
assert.ok(!components.includes('bs-carousel'), 'expected not to find bs-carousel in embroider build');
}
assert.ok(!components.includes('bs-carousel'), 'expected not to find bs-carousel in embroider build');
});
});
`,
Expand All @@ -279,32 +271,7 @@ wideAppScenarios
let helpers = [...document.querySelectorAll("[data-helper-name]")].map(elt => elt.dataset.helperName);
assert.ok(!helpers.includes('reverse'), 'expected not to find reverse, because it is provided directly via scope');
if (getOwnConfig().isClassic) {
assert.ok(helpers.includes('intersect'), 'expected to find intersect');
} else {
assert.ok(!helpers.includes('intersect'), 'expected not to find intersect');
}
});
});
`,
'macros-example-test.js': `
import { module, test } from 'qunit';
import { visit } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import { getOwnConfig } from '@embroider/macros';
module('Acceptance | macros-example', function(hooks) {
setupApplicationTest(hooks);
test('macros work', async function(assert) {
await visit('/macros-example');
if (getOwnConfig().isClassic) {
assert.dom('[data-macro]').hasText('Welcome to this classic app!');
} else {
assert.dom('[data-macro]').hasText('Welcome to this embroider app!');
}
assert.ok(!helpers.includes('intersect'), 'expected not to find intersect');
});
});
`,
Expand Down Expand Up @@ -363,7 +330,6 @@ wideAppScenarios
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const { MacrosConfig } = require('@embroider/macros/src/node');
const { maybeEmbroider } = require('@embroider/test-setup');
module.exports = function (defaults) {
Expand All @@ -377,10 +343,6 @@ wideAppScenarios
}
});
MacrosConfig.for(app).setOwnConfig(__filename, {
isClassic: Boolean(process.env.CLASSIC),
});
return maybeEmbroider(app, {
packageRules: [
{
Expand Down

0 comments on commit 203b5bc

Please sign in to comment.