1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

feat: archived features will be included in onboarding (#8350)

Now when you are finished onboarding and you archive feature, you will
not restart onboarding.
This commit is contained in:
Jaanus Sellin 2024-10-03 13:01:45 +03:00 committed by GitHub
parent 38b33aa032
commit e8e005daa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 2 deletions

View File

@ -30,7 +30,9 @@ afterAll(async () => {
}
});
beforeEach(async () => {});
beforeEach(async () => {
await featureToggleStore.deleteAll();
});
test('can get instance onboarding durations', async () => {
const initialResult =
@ -153,3 +155,26 @@ test('can get project onboarding status', async () => {
status: 'onboarded',
});
});
test('archived feature counts as onboarded', async () => {
await featureToggleStore.create('default', {
name: 'my-flag',
createdByUserId: SYSTEM_USER.id,
});
await lastSeenStore.setLastSeen([
{
environment: 'default',
featureName: 'my-flag',
},
]);
await featureToggleStore.archive('my-flag');
const onboardedResult =
await onboardingReadModel.getOnboardingStatusForProject('default');
expect(onboardedResult).toMatchObject({
status: 'onboarded',
});
});

View File

@ -86,7 +86,6 @@ export class OnboardingReadModel implements IOnboardingReadModel {
const feature = await this.db('features')
.select('name')
.where('project', projectId)
.where('archived_at', null)
.first();
if (!feature) {