-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Why does this PR exist? Closes #2681 <!-- Describe the problem you're addressing and the rationale behind this PR. --> ### What does this pull request do? There's some issues with the launchdarkly feature flags causing our flags to not be loaded in on initial load. It sounds related to launch darkly itself, so I'm moving all our flags to the more generic `isProUser` check, which works fine. All those flags have long been shipped to all users anyway, so we should've removed these gated feature flags a long time ago, anyway. Also changes cypress tests to be mocked with a valid license instead of relying on feature flags ### Testing this change Start the plugin, immediately click on Manage themes and notice that it will work, compared to the beta build ## Before Notice how it says "PRO" in the bottom but manage themes is disabled  ## After <img width="512" alt="CleanShot 2024-04-24 at 22 36 14@2x" src="https://github.com/tokens-studio/figma-plugin/assets/4548309/7d127f4d-73ea-4c3a-99cd-0eb2c0a364e3">
- Loading branch information
Showing
22 changed files
with
162 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/tokens-studio-for-figma/cypress/e2e/helpers/utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export const fillTokenForm = ({ | ||
name, value | ||
}) => { | ||
cy.get('input[name=name]').type(name); | ||
cy.get('[data-testid=mention-input-value]').type(value); | ||
cy.get('[data-testid=mention-input-value]').type('{enter}'); | ||
}; | ||
|
||
export const fillInputNth = ({ | ||
submit = false, input, value, nth, | ||
}) => { | ||
cy.get(`[data-testid=mention-input-${input}]`).eq(nth).type(`{selectall}${value}`); | ||
|
||
if (submit) { | ||
cy.get(`[data-testid=mention-input-${input}]`).eq(nth).type('{enter}'); | ||
} | ||
}; | ||
|
||
export const fillValueInput = ({ | ||
submit = false, input, value | ||
}) => { | ||
cy.get(`[data-testid=mention-input-${input}]`).type(`{selectall} ${value}`); | ||
|
||
if (submit) { | ||
cy.get(`[data-testid=mention-input-${input}]`).type('{enter}'); | ||
} | ||
}; | ||
|
||
export const fillInput = ({ | ||
submit = false, input, value | ||
}) => { | ||
cy.get(`input[name=${input}]`).type(`{selectall} ${value}`); | ||
|
||
if (submit) { | ||
cy.get(`input[name=${input}]`).type('{enter}'); | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,30 @@ const MockEnv = () => { | |
email: '[email protected]', | ||
}).as('getUser'); | ||
|
||
cy.intercept('POST', `https://api-eu.mixpanel.com/**`, { | ||
success: true | ||
}).as('mixpanel') | ||
|
||
cy.intercept('GET', `https://api.storyblok.com/**`, { | ||
success: true | ||
}).as('storyblok') | ||
|
||
cy.intercept('GET', `https://app.launchdarkly.com/**`, { | ||
success: true | ||
}).as('app-launchdarkly') | ||
|
||
cy.intercept('POST', `https://events.launchdarkly.com/**`, { | ||
success: true | ||
}).as('events-launchdarkly') | ||
|
||
cy.intercept('GET', `**/get-license*`, { | ||
plan: 'pro' | ||
}).as('getLicense') | ||
|
||
cy.intercept('GET', `**/validate-license*`, { | ||
plan: 'pro' | ||
}).as('validateLicense') | ||
|
||
cy.intercept('GET', 'http://localhost:58630/six7/repos/122/figma-tokens/collaborators/six7/permission', { | ||
permission: 'admin', | ||
role_name: 'admin' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.